我使用pipenv
创建了一个虚拟环境。稍后,我安装了camelcase
模块。我安装了它,这里是pipfile
:
# cutted for brevity
[dev-packages]
pytest = "*"
[packages]
requests = "*"
bs4 = "*"
beautifulsoup4 = "*"
pillow = "*"
camelcase = "*"
[requires]
python_version = "3.7"
您会看到已安装最新版本的camelcase,但是当我在完全相同的激活的虚拟环境中制作了file.py
文件并在其中添加了以下代码:
from camelcase import CamelCase
c = CamelCase()
txt = 'this is a text'
res = c.hump(txt)
print(res)
这是我得到的错误:
Traceback (most recent call last):
File "c:\py\virtualenv\new.py", line 1, in <module>
from camelcase import CamelCase
ModuleNotFoundError: No module named 'camelcase'
那是为什么? 我安装了它并激活了我的虚拟环境。我还有什么想念的吗?谢谢