推荐学习书目
› 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
IVeverKB
V2EX  ›  Python

windows 下用 powershell 和用 cmd 运行 Python 有什么区别吗

  •  
  •   IVeverKB · Jun 8, 2021 · 2820 views
    This topic created in 1947 days ago, the information mentioned may be changed or developed.

    是这样的。在同一个 python 虚拟环境下(安装有 PyYAML 包),在 cmd 中 import yaml 一切正常,在 powershell 下 import yaml 就会提示 No module named 'yaml'

    请教一下是什么问题

    4 replies  •  2021-06-08 19:07:07 +08:00
    AoEiuV020
        1
    AoEiuV020  
       Jun 8, 2021 via Android
    环境变量不同吧,
    IVeverKB
        2
    IVeverKB  
    OP
       Jun 8, 2021
    @AoEiuV020 #1
    关键其他包都没有问题的
    yanq123
        3
    yanq123  
       Jun 8, 2021
    ```
    >>> import sys
    >>> sys.path
    ```
    看看有没有差别
    IVeverKB
        4
    IVeverKB  
    OP
       Jun 8, 2021
    @saucerman8 #3
    谢谢具体指导。还真有些许的差异。之前偷懒虚拟环境直接从别的路径复制粘贴过来的,弄着弄着就乱了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5944 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 06:31 · PVG 14:31 · LAX 23:31 · JFK 02:31
    ♥ Do have faith in what you're doing.