为什么已安装的程序包在激活的Pipenv虚拟环境中不起作用?

时间:2019-07-16 06:41:57

标签: python virtualenv pipenv

我使用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'

那是为什么? 我安装了它并激活了我的虚拟环境。我还有什么想念的吗?谢谢

0 个答案:

没有答案