How do I add a path to PYTHONPATH in virtualenv

后端 未结 5 1222
渐次进展
渐次进展 2020-11-27 09:29

I am trying to add a path to the PYTHONPATH environment variable, that would be only visible from a particular virtualenv environment.

I tried SET PYTHONPATH=

5条回答
  •  孤街浪徒
    2020-11-27 10:01

    You can usually avoid having to do anything with PYTHONPATH by using .pth files. Just put a file with a .pth extension (any basename works) in your virtualenv's site-packages folder, e.g. lib\python2.7\site-packages, with the absolute path to the directory containing your package as its only contents.

提交回复
热议问题