0

我格式化了我的电脑以查找站点包,但使用这些必要的行我看不到它们。

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

我没有找到路径(我想看看那些路径):

'/usr/local/lib/python2.7/site-packages'

'/usr/local/lib/python3.5/site-packages'

输出是:

redhwan@redhwan:~$ python
Python 2.7.12 (default, Nov 12 2018, 14:36:49) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print ('\n'.join(sys.path))

/usr/lib/python2.7
/usr/lib/python2.7/plat-x86_64-linux-gnu
/usr/lib/python2.7/lib-tk
/usr/lib/python2.7/lib-old
/usr/lib/python2.7/lib-dynload
/usr/local/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages
4

1 回答 1

0

我来到 这里,这是一个非常好的博客。

有人评论

export PYTHONPATH="/usr/lib/python2.7/site-packages:/usr/local/lib/python2.7/site-packages:/usr/local/lib/python2.7/dist-packages"

但我不知道这个动作是否还有其他问题。

于 2020-07-04T11:23:30.773 回答