推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
daijinming
V2EX  ›  Python

Python3 运行一个导入 pika 模块的 文件 product.py 提示 ModuleNotFoundError

  •  
  •   daijinming · Mar 5, 2019 · 3227 views
    This topic created in 2629 days ago, the information mentioned may be changed or developed.

    之前在目录下已经执行过pipenv install pika,Pipfile 中已经存在 pika = "*" , 并且在 Pycharm 中运行完全没有问题,但是不知道为什么,在命令行中运行 python3 product.py 提示

    ModuleNotFoundError: No module named 'pika'

    代码地址

    求指教

    4 replies    2019-03-05 17:57:20 +08:00
    ysc3839
        1
    ysc3839  
       Mar 5, 2019 via Android
    命令行忘记执行 pipenv shell ?
    daijinming
        2
    daijinming  
    OP
       Mar 5, 2019
    @ysc3839 先执行了下 pipenv shell,在执行就可以了。为什么那,有的 .py 就不用执行
    baichen99
        3
    baichen99  
       Mar 5, 2019 via iPhone
    @daijinming 因为你使用的库在全局环境已经存在了
    daijinming
        4
    daijinming  
    OP
       Mar 5, 2019
    @baichen99 那明白了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2964 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 02:36 · PVG 10:36 · LAX 19:36 · JFK 22:36
    ♥ Do have faith in what you're doing.