简体   繁体   中英

How to install pycurl on a win32 machine without compiling

Please bear with me as I am completely new to programming/python, etc.

I am attempting to install the pycurl module on my local win32 machine. I do not know anything about compiling, and I have attempted to install the module through an msi installer located here:

http://pycurl.sourceforge.net/download/

and I am using the pycurl-7.19.5.win32-py3.4.msi download, with Python 3.4.

I have downloaded it, and when I attempt to run a python query using the command prompt, I receive the error:

ImportError: No module named 'pycurl'

When I run the script without importing pycurl, it runs fine, so I know I have python installed successfully.

What am I doing wrong? I don't want to resort to compiling as that is going in completely foreign territories for me. I'd like to learn how to install modules into python for future purposes as well.

Try installing pycurl from this site , where all modules are as Windows binaries. Installing it and then trying to import pycurl works fine for me (you have to download appropiate .whl for your Python version & platform, then run):

..\Downloads>pip install pycurl-7.19.5.3-cp35-none-win32.whl
Installing collected packages: pycurl
Successfully installed pycurl-7.19.5.3

..\Downloads>python
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:16:59) [MSC v.1900 32 bit (Intel)] on win32
>>> import pycurl
>>> pycurl
<module 'pycurl' from 'C:\\Program Files (x86)\\Python 3.5\\lib\\site-packages\\pycurl.cp35-win32.pyd'>

The problem you describe may happen when you have multiple versions of Python installed without using virtualenv .

Use pip instead:

pip install pycurl

Edit 2020-12-11:

Pycurl no longer builds binaries. The last binaries available are for Python 3.4 or 3.5.

If you're still using Python 3.4/3.5, and you don't want to/can't build from source, you can install the last available official binary builds from pip using:

pip3 install --only-binary :all: pycurl

WARNING: the latest binary build may be behind the latest source version and therefore have security bugs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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