简体   繁体   English

在另一个virtualenv中安装pycurl

[英]install pycurl in another virtualenv

Here is my situation: 这是我的情况:

I work on a python project in which we work within a particular, project-oriented-and-customized virtual environment. 我从事的是python项目,我们在一个特定的,面向项目和自定义的虚拟环境中工作。

However at some point I need to introduce 3rd party modules into this venv, concretely speaking, pycurl and openpyxl. 但是,在某些时候,我需要在此venv中引入第3方模块,具体来说就是pycurl和openpyxl。 Presently I had to run certain python scripts depending on these two modules from anaconda's venv, which includes those two. 目前,我必须根据anaconda的venv中的这两个模块运行某些python脚本,其中包括这两个模块。

I don't feel like to switch back and forth between these two venvs. 我不想在这两个静脉之间来回切换。

We have a corp firewall stopping direct access to outside code repository. 我们有公司防火墙阻止直接访问外部代码存储库。 I managed, however, to download pycurl from https://dl.bintray.com/pycurl/pycurl/ , after unzip it (BTW, I use Windows), I noticed these two packages 但是,我设法从https://dl.bintray.com/pycurl/pycurl/下载了pycurl,将其解压缩后(顺便说一句,我使用Windows),我注意到了这两个软件包

site-packages\curl
site-packages\pycurl-7.43.0-py3.5.egg-info

In my project's directory tree, I found bunches of modules pretty much in line with the naming conventions as above, they are all under: 在我的项目的目录树中,我发现许多模块与上面的命名约定非常相似,它们都在下面:

my_project\PythonVenv\Lib\site-packages

Then I copied curl and pycurl-7.43.0-py3.5.egg-info there and re-activate the project's venv, and tried running the script, still it complains: 然后我在其中复制curl和pycurl-7.43.0-py3.5.egg-info并重新激活项目的venv,并尝试运行脚本,但仍然抱怨:

ModuleNotFoundError: No module named 'pycurl'

Maybe simply copying doesn't work? 也许只是复制不起作用? Do I need to use something like "python setup.py" or "pip install". 我需要使用“ python setup.py”或“ pip install”之类的东西吗?

First, I didn't see setup.py coming with the pycurl package; 首先,我没有看到pycurl包附带setup.py; secondly "pip install" not work due to the corp firewall. 其次,由于公司防火墙的原因,“ pip install”不起作用。

Anyone can help? 有人可以帮忙吗? Thanks. 谢谢。

On Windows you should be using the Windows binary packages. 在Windows上,您应该使用Windows二进制包。 It sounds like you are trying to unpack the source distribution. 听起来您正在尝试解压缩源分发包。

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

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