Python自定义包在linux服务器导入错误的解决办法
发布日期:2021-05-14 11:05:16 浏览次数:15 分类:精选文章

本文共 1907 字,大约阅读时间需要 6 分钟。

������������������������������������Python���������������������������������������������������������������������������������������������������������������������������

1. ������������������

  • ������������������������������������������������������������sys.path���������������������
  • ���������������������������������������������Python������������������������������������������������site-packages������������python-path.txt������������

Server Python ���������������������

������1���������Python������������

������������������Python������������������������

���������ConvLab������������������Python��������� /home/huangqiao/anaconda3/envs/convlab/lib/python3.6/

������2���������Python������������

������������������������������������

cd /home/huangqiao/anaconda3/envs/convlab/lib/python3.6/

������3���������������������������������

������������������������python.pth���������

touch python.pth

������4���������.pth������

���������������������python.pth���������

vi python.pth

������5������������������������

���.pth���������������������������������������������������������������������������������

  • ������������������������������������__init__.py���������
  • ������������������������������/full/path/to/your/package/

������������

  • ���������������������������������������������������������__init__.py���������
  • ���������������������������������������������������������������Python���������������������
  • ������������������������������������������Python���������������������������������������������

������������

���Python������������������������������������������������������������������������

import sys
sys.path

���������������������������������sys.path������������

������������������

���������������������������������PYTHONPATH������������������������������������������������������������������������������site-packages������������������

���������������������������������������������������������������������������Python������

上一篇:安装glibc
下一篇:服务器OSError: [Errno 98] Address already in use

发表评论

最新留言

表示我来过!
[***.240.166.169]2025年04月28日 22时14分04秒