Python Virtualenv - No module named virtualenvwrapper.hook_loader

前端 未结 16 1525
野趣味
野趣味 2020-12-02 06:01

I\'m running Mac OS 10.6.8. and wanted to install in addition to python 2.6 also python 2.7 and use python 2.7 in a new virtualenv. I executed the following steps:

I

16条回答
  •  没有蜡笔的小新
    2020-12-02 06:34

    I had the same problem as this one and spent so much time on configuring out what was wrong. And I finally found out what was wrong.

    First I looked for where virtualenvwrapper folder exists. In my case /usr/local/lib/python3.7/site-packages. Inside the folder is hook_loader.py that caused the error.

    Next, I used python script.

    python3
    
    import sys;print('\n'.join(sys.path))
    

    I couldn't find the /usr/local/lib/python3.7/site-packages directory so, at last I wrote,

    export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.7/site-packages
    

    to .bashrc file. Done.

    Meaning of PYTHON PATH

    As you can see in above link, PYTHONPATH augment the default search path for modules.

提交回复
热议问题