简体   繁体   English

如何使用便携式 python.exe 启动 python package? 它不会找到 package

[英]How do I launch a python package using portable python.exe? It won't find the package

I have a python package that I launch using system python from CMD like this:我有一个 python package,我使用系统 python 从 CMD 启动,如下所示:

python -m packagename.scriptname

However, I need this to work using embedded/portable Python, but I always get "Error while finding module specification".但是,我需要使用嵌入式/便携式 Python 来工作,但我总是收到“查找模块规范时出错”。

I have already tried setting PYTHONPATH to the folder the package is in, which didn't work.我已经尝试将 PYTHONPATH 设置为 package 所在的文件夹,但没有用。 Neither does using an absolute path (like "-m D:/packages/thepackage/packagename.scriptname").使用绝对路径(如“-m D:/packages/thepackage/packagename.scriptname”)也不行。

How do I run this package using portable python?如何使用便携式 python 运行此 package?

I would try installing the package locally to the embedded python. For example /path/to/embedded/python.exe -m pip install /path/to/packagename ?我会尝试将 package 在本地安装到嵌入式 python。例如/path/to/embedded/python.exe -m pip install /path/to/packagename

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM