微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用setup.py自定义python软件包安装

如何解决使用setup.py自定义python软件包安装

我想安装一个python软件包(用cython编写的第三方软件包,用于一些数值计算)。 我以前的经验(成功的经验)是,我只需要执行以下命令:

python setup.py install --prefix="/destination/path/"

然后,我希望有一个附加文件夹作为/ destination / path / package 所以,我可以做

export PYTHONPATH=$PYTHONPATH:/destination/path/

因此,我终于可以正常地使用python脚本导入软件包了。

但是,似乎setup.py(我正在使用anaconda python3.7)的认行为已更改。当我使用相同的(第一个)命令时,遇到以下错误

Checking .pth file support in /destination/path//lib/python3.7/site-packages/

/path/to/python -E -c pass

TEST Failed: /destination/path/lib/python3.7/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from.  The
installation directory you specified (via --install-dir,--prefix,or
the distutils default setting) was:

/destination/path/lib/python3.7/site-packages/

有人可以向我解释发生了什么,如何解决错误

非常感谢您。

最好

格雷格

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。