我想设置pythonpath,但它不适用于其他目录。
我的 .bashrc:
导出 PYTHONPATH=/usr/lib/python2.7
导出 PYTHONPATH=$PYTHONPATH/plat-linux2:$PYTHONPATH/lib-dynload:$PYTHONPATH/dist-packages:$PYTHONPATH/lib-tk:$PYTHONPATH
如果我只保留第一行(单个目录)
export PYTHONPATH=/usr/lib/python2.7
,那么我的 bash shell 会将我带到 /usr/lib/python2.7 目录。
但是当我包含多个目录时 -
export PYTHONPATH=$PYTHONPATH/plat-linux2:$PYTHONPATH/lib-dynload:$PYTHONPATH/dist-packages:$PYTHONPATH/lib-tk:$PYTHONPATH
它会抛出类似 bash: cd: /usr /lib/python2.7/plat-linux2:/usr/lib/python2.7/lib-dynload:/usr/lib/python2.7/dist-packages:/usr/lib/python2.7/lib-tk: /usr/lib/python2.7:没有这样的文件或目录