Python 3.5 - how to install lxml in Windows 7 64 bits - python

I am trying to install lxml with Python (32 bits) 3.5.1, on Windows 7 64 bits. I tried pip install lxml, but I got the famous error for missing "vcvarsall.bat". If I try to Install visual studio 2015, it requires 6 GB of free space, which I do not have available at the moment, and I'd rather not install a package which I do not plan to use.
I tried downloaded the wheel as suggested here and here, but I still get the whl file "is not a supported wheel on this platform". Wheel and pip are upgraded to the latest versions. What am I missing...?

I have been struggling with this today. I found, elsewhere on stackoverflow.com, this two-part and quick solution, which resulted in python no longer complaining when I tried to use lxml:
go to this repository and download a version which matches your Python installation (the version number, and 32- vs 64-bit. I use Python 3.5.1 64-bit, installed on Windows 10, so on that page, I chose lxml-3.6.0-cp35-cp35m-win_amd64.whl. You say you use the 32-bit version, so use a version that matches that.
My download directory is d:\Downloads. Python must be in your PATH environment variable for the next step to work. Use a command like the following, changing "D:\Downloads" to the pathname to your download directory. Then, at a DOS prompt, type:
python -m pip install "D:\Downloads\lxml-3.6.0-cp35-cp35m-win_amd64.whl" lxml-3.6.0-cp35-cp35m-win_amd64.whl

Related

python3 pip fails to install jupyter on windows 10

I want to install jupyter on Win 10. I have been using python on linux, but this is my first time on Win 10.
when I execute python -m pip install jupyter on administrator, I got errors like this:
The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been aborted.
This package cannot be safely installed by EasyInstall, and may not
support alternate installation locations even if you run its setup
script by hand. Please inform the package's author and the EasyInstall
maintainers to find out if a fix or workaround is available.
any idea?
I have been able to get around this error by installing Anaconda, uninstalling Python 3.8.0 and installing Python 3.7.5 instead.
The Jupyter installation then ran successfully when I executed pip install jupyter with Git Bash in my C:\ drive using pip 19.2.3 (the default with Python 3.7.5).
For those who encounter this and need to use Python 3.8+, make sure to update you setuptools to version 42.0.0 (or later).
Install a version earlier than python 3.8 and the installation will work. Use CMD.
I had the same problem, I am using 64-bit windows 10 but downloaded the 32-bit python installer because it is the default that appears on the 'downloads' page on the python.org site. Uninstalled python 3.8.1, downloaded the 64-bit installer instead, and then ran 'pip install jupyterlab' using the pip version 19.2.3 that got installed with the 64-bit python instead of upgrading to pip version 19.3.1. So if you are running a 64-bit version of windows, make sure you download the 64-bit python installer!

Unsupported Wheel Error when pip installing PyTorch without Conda

I have been trying to install PyTorch in Windows 10 for Python 3.7.1
I do not have Anaconda on my machine, and do not wish to install it. I believe I have already satisfied all the necessary prerequisites (CUDA v10.0, NumPy). When I run the following installation command in the admin command line, (found on the PyTorch webpage):
pip3 install https://download.pytorch.org/whl/cu100/torch-1.0.0-cp37-cp37m-win_amd64.whl
I received the following error:
torch-1.0.0-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.
I tried downloading the wheel file in my browser, then running a modified command in my downloads directory.
pip install torch-1.0.0-cp37-cp37m-win_amd64.whl
I received the same error message. My pip version is up to date and I am attempting to install the appropriate wheel file for my Python version. This problem is unique to others, as I do not want to use Conda to install PyTorch. What is causing this problem?
The wheel I was trying to install required 32 bit Python, I had 64 bit Python installed. Therefore, the wheel I was trying to install was not compatible with my Python version.
Checking Python Version:
I confirmed my Python version using the following command:
python -c "import struct; print(struct.calcsize('P') * 8)"
Checking Wheel Version:
64 bit wheels typically contain amd64 or similar in their title
32 bit wheels typically contain win32or similar in their title
Switching to a 64 bit Python Installaion:
The default Windows Python installer does not have a 64 bit option. To acquire 64 bit Python, navigate to python.org/downloads/windows/, and select a version that specifies x86-64 (the other versions are all 32 bit).
Credit to phd for the comment that led to this solution.
A Redditor had the same problem here.

Installing python gtk on windows 7 64-bit

I'm trying to install python gtk on a windows 7 64-bit machine. I'm following
python pygtk windows 7 64 bit
to do so. I've followed steps 1-4 in this link, and all was fine, but on step 5 (installing the libraries gtk,PyCairo,goobject), there are no .exe's in the link. I followed comments in the answer, which say to pip install the .whl file. So I installed pip:
"pip --version" in CMD yields "pip 8.1.2 from c:\python35-32\lib\site-packages (python 3.5)".
Also,
"python --version" in CMD yields "Python 3.5.2".
Then, in CMD:
>pip install pycairo_gtk-1.10.0-cp27-none-win_amd64.whl
pycairo_gtk-1.10.0-cp27-none-win_amd64.whl is not a supported wheel on this platform.
So I then searched this online and found this post:
filename.whl is not supported wheel on this platform
Which just seems to indicate that the filename needs to be of a particular format.
Question: Is the filename I downloaded somehow wrong? Or needs to be renamed?
I'm sorry if this is just a duplicate of the last link, but it seems to me that a step-by-step of installing python gtk is incomplete for windows 7 64-bit, which is the root of my question.

Python error when installing package using wheel files

I am trying to install pyHook with a wheel file (.whl) but for some reason it keeps giving me this error:
pyHook-1.5.1-cp34-none-win_amd64.whl is not a supported wheel on this platform.
I got the wheel file from this website:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
The command I use is:
pip install pyHook-1.5.1-cp34-none-win_amd64.whl
I have no idea what to do, I cant find any suggestions.
Python version 2.7
pip version 6.0.6
You are installing a Wheel created for Python 3.4, into Python 2.7. That won't work. Use the correct version and download the one with cp27 in the name:
pyHook‑1.5.1‑cp27‑none‑win_amd64.whl
I ran into the same issues whilst trying to install pyhook on Python 3.4. I downloaded the correct version from python software foundation.
I had to manually change the name of the file from pyHook_3k_compiled-1.5.1-cp34-cp34m-win_amd64.whl to pyHook-1.5.1-cp34-none-win_amd64.whl.
pip install pyHook-1.5.1-cp34-none-win_amd64.whl
And it worked!
You may not have installed the correct one for your operating system check whether it is the 32 bit or 64 bit variant and install it again

install python3 + lxml on windows

I would like to install python3 with lxml on windows 7.
There seems to be several versions available.
What's the best version/way to install?
By best I mostly mean the easiest.
Points if I don't have to compile anything.
I had the same problem locating the correct version. After several hours of confusion I finally found the windows binary for Python 3 at Christoph Gohlke's Unofficial Windows Binaries for Python Extension Packages website at UC, Irvine.
He truly has the A-Z of Python extensions, as long as it's available for Python. Anything one could want from the PIP installer to Chinese word segmentation, to a multi-taper Fourier spectral estimator. Beyond that it gets into biologic & scientific specialty extensions.
Use the current stable version of 3, 3.2.2. You can find a windows installer here http://python.org/ftp/python/3.2.2/python-3.2.2.msi that will install python for you.
Use the Python Package Index version of lxml: it has a windows installer specifically for Python 3.
http://pypi.python.org/packages/3.1/l/lxml/lxml-2.2.8.win32-py3.1.exe#md5=d1fb73a8596bb77e155cef7ae6b0bc53
Download and run the Python installer then download and run the lxml installer: it should be that easy.
No compilations and IMHO, the best way:
Mainly because the instructions below the most complete and still FAST to complete. On more than one occasions, using just the MSI and the LXML binaries, I've run into issues with the install breaking/getting gcc and mingw errors.
These instructions are for Windows7 or Windows8 with Python3.3.
However, they should work for various versions as the releases of python and other respective prerequisites change/evolve:
Install Python3.3:
Download the last release of Python3.3 (currently 3.3.5) from the downloads page HERE
Direct link for Win32 MSI installer -> HERE
Direct link for Win64 MSI installer -> HERE
Simply run the MSI to install python. It will register itself in the registry, and appear in Add/REmove Programs.
NOTE: my instructions that follow assume that you choose to install python to the default path of C:\python33\ when asked during the Python Installation Wizard
Add the C:\python33\ and C:\python33\scripts folders to the system path by adding those directories to the PATH environment variable from the Control Panel > System > Advanced System Settings link (Advanced Tab) > Environmental Variables (Button).
(OPTIONAL) Install OpenSSL:
Download Win32 OpenSSL page from HERE for your version of Windows and PC architecture
Download Visual C++ 2008 redistributables for your version of Windows and PC architecture
Download OpenSSL for your version of Windows and architecture (the regular version, not the light one)
Add the following (depending on your architecture) directory (or wherever you insalled to) to your PATH, the same way you added C:\python33 and C:\python33\scripts above:
32-bit: c:\openssl-win32\bin
64-bit: c:\openssl-win64\bin
Install Setuptools (get-pip.py should install Setuptools for you), but, just in case...
Download ez_setup.py HERE and save it in C:\python33\scripts
Run C:\python33\scripts> python ez_setup.py
Install PIP
Download get-pip.py from HERE and save it in C:\python33\scripts
Run C:\python33\scripts> python get-pip.py
Install LXML
Download LXML 3.3.3 from HERE for your version of Windows and PC architecture
Run the EXE file
The latest version of lxml (3.6.0) now supports the Wheel format, so there is no problem with installing it with pip:
pip install lxml
Worth noting that Python3 is only supported on Windows 7 up to version 3.8.6 - beyond that it fails to install with an error similar to the following in the Python log file:
[2490:291C][2020-11-14T14:22:21]e000: Windows 8.1 or later is required to continue installation
This is mentioned in the Python Releases for Windows download page:
Note that Python 3.9.0 cannot be used on Windows 7 or earlier.
[...]
Note that Python 3.8.6 cannot be used on Windows XP or earlier.
Hence if installing with Chocolatey, the following command is needed:
choco install python3 --version 3.8.6

Categories

Resources