我是想在py脚本执行时,激活指定的环境。可以做到吗?
PS:我是李世石,我已经弃围棋从AI了,大家多指教!
PHP中文网2017-04-18 10:26:27
sys.path.insert
Your environment directory. For example:
sys.path.insert(0, "/tmp/python2.7.8/lib/python2.7/site-packages/")
PHP中文网2017-04-18 10:26:27
Yes, you need to use the absolute path to specify the python you use (in the virtual environment). The rough writing method is as follows
/PATH/venv/bin/python /PATH/script.py
怪我咯2017-04-18 10:26:27
Spend half an hour and read through the documentation of virtualenvwrapper, and all the problems will be solved