代码之家  ›  专栏  ›  技术社区  ›  Deepend user3175560

virtualenv-p在创建新的虚拟环境时删除sys.prefix文件路径的最后一部分

  •  0
  • Deepend user3175560  · 技术社区  · 10 年前

    当我尝试使用python的The Enthought Canopy发行版创建一个新的虚拟环境时,我一直遇到以下问题

    localhost:workspace brendan$ virtualenv -p /Users/brendan/Library/Enthought/Canopy_64bit/User/bin/python test
    Running virtualenv with interpreter /Users/brendan/Library/Enthought/Canopy_64bit/User/bin/python
    Using base prefix '/Applications/Canopy.app/appdata/canopy-1.4.1.1975.macosx-x86_64/Canopy.app/Contents'
    New python executable in test/bin/python
    dyld: Library not loaded: @rpath/Python
      Referenced from: /Users/brendan/Dropbox/workspace/test/bin/python
      Reason: image not found
    ERROR: The executable test/bin/python is not functioning
    ERROR: It thinks sys.prefix is u'/Users/brendan/Dropbox/workspace' (should be u'/Users/brendan/Dropbox/workspace/test')
    ERROR: virtualenv is not compatible with this system or executable
    localhost:workspace brendan$ 
    

    我不知道为什么它总是掉最后一部分 sys.prefix 或者我该如何解决这个问题。

    这是 related to a previous question I posted 其中这是建议的解决方案。

    非常感谢您的帮助

    谢谢

    1 回复  |  直到 8 年前
        1
  •  1
  •   Jonathan March    10 年前

    Canopy构建在Python 3的后端上 venv 。因此,virtualenv不能在Canopy Python中使用。大多数virtualenv用户应该能够毫无困难地使用venv。然而,我们认识到这确实给一些用户带来了问题。因此,下一步 专业 发布Canopy(无预计到达时间——未来几个月内不会)将支持这两种选择。