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

(windows)在一台新的电脑没安装 Python ,只是从旧电脑 copy 了虚拟环境的文件夹进去,可以单独运行脚本吗?

  •  1
     
  •   wyc9296 · Apr 3, 2019 · 2937 views
    This topic created in 2732 days ago, the information mentioned may be changed or developed.

    把虚拟环境的 scripts 目录下所有 text 格式的文件中路径都更改了;如果安装 python 的话,虚拟环境运行里面的脚本 ok,但是把 python 卸载掉,就会报错:

    Failed to import the site module
    Traceback (most recent call last):
      File "C:\Users\E\Desktop\moduleTest\venv\lib\site.py", line 791, in <module>
        main()
      File "C:\Users\E\Desktop\moduleTest\venv\lib\site.py", line 768, in main
        paths_in_sys = addsitepackages(paths_in_sys)
      File "C:\Users\E\Desktop\moduleTest\venv\lib\site.py", line 280, in addsitepackages
        addsitedir(sitedir, known_paths)
      File "C:\Users\E\Desktop\moduleTest\venv\lib\site.py", line 211, in addsitedir
        addpackage(sitedir, name, known_paths)
      File "C:\Users\E\Desktop\moduleTest\venv\lib\site.py", line 179, in addpackage
        exec(line)
      File "<string>", line 1, in <module>
      File "C:\Users\E\Desktop\moduleTest\venv\lib\importlib\util.py", line 13, in <module>
        from contextlib import contextmanager
    ImportError: No module named 'contextlib'
    
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2627 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 13:11 · PVG 21:11 · LAX 06:11 · JFK 09:11
    ♥ Do have faith in what you're doing.