In Win7, in python 3.4, in pandas, I tried to run pd.read_html.
It aborted, saying it couldn't find lxml.
I added "import lxml", and it said there was no module by that name.
I ran "pip install pandas lxml", and it aborted, saying
C:\Python34\hsf\pandas>pip install pandas lxml
Requirement already satisfied (use --upgrade to upgrade): pandas in c:\python34\
lib\site-packages
Downloading/unpacking lxml
Running setup.py (path:C:\Users\Windows\AppData\Local\Temp\pip_build_Windows\l
xml\setup.py) egg_info for package lxml
Building lxml version 3.4.4.
Building without Cython.
ERROR: b"'xslt-config' is not recognized as an internal or external command,
\r\noperable program or batch file.\r\n"
** make sure the development packages of libxml2 and libxslt are installed *
*
I tried pip to install libxml2, and libxslt, and that aborted saying:
C:\Python34\lib\distutils\dist.py:260: UserWarning: Unknown distribution option:
'bugtrack_url'
warnings.warn(msg)
error: Unable to find vcvarsall.bat
Prior SO answers to similar questions said "use sudo..." so were inapplicable to windows.
How can I install lxml in python 3.4 on Win7 ?
You can try the following:
pip install lxml
For the vcvarvasall.bat you can try installing: https://www.microsoft.com/en-us/download/details.aspx?id=44266
If none of those work you can download the precompiled binary here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
The last option is the easiest. Here are the steps:
1) Download the wheel at http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
2) pip install wheel
3)pip install "path to where you downloaded the *.whl from step 1"
Related
I'm trying to install geopandas on my M1 mac and I'm running into errors
I tried to pip install all the dependencies individually but where I'm tripping up is in the install of pyproj.
I installed PROJ using brew install proj and that worked fine
When I try to pip install pyproj, I get the follow error
Building wheels for collected packages: pyproj
Building wheel for pyproj (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pyproj (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
PROJ_DIR is set, using existing PROJ installation..
running bdist_wheel
running build
running build_py
running build_ext
building 'pyproj._geod' extension
pyproj/_geod.c:704:10: fatal error: 'geodesic.h' file not found
#include "geodesic.h"
^~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyproj
Failed to build pyproj
ERROR: Could not build wheels for pyproj, which is required to install pyproject.toml-based projects
Any help would be much appreciated
At the moment, installing geopandas on M1 macs can be achieved via conda or pip+homebrew.
GeoPandas itself is written in pure Python, so there is no issue running that on any architecture. However, it depends on other libraries that are written in other languages (C, C++) that need to be compiled specifically for M1 chips. While you could compile it yourself, I am not going to cover this option as it is not user friendly.
There are three possible sources of required libraries - pip wheels, conda-forge, and Homebrew.
When a Python package requires C dependency, it can create wheels with the dependency compiled for each system and chip architecture. See for example pygeos - https://pypi.org/project/pygeos/#files. What you need is *macosx_11_0_arm64.whl . If your package doesn't offer it, you have to find another way of installing than pip. Since GeoPandas requires shapely and fiona (among others) that do not have these wheels, you should look elsewhere - either on conda-forge or Homebrew. Below are both options tested as of today.
Conda and conda-forge way (recommended)
Conda-forge currently has all packages geopandas needs
Install M1 version of miniforge or mambaforge. It can be downloaded from here - https://github.com/conda-forge/miniforge.
conda install -c conda-forge geopandas pygeos
Note: if you install x86 (Intel) version of conda, it will run under Rosetta2 and install all packages using x86 architecture, meaning that everything will run under emulation. Try to avoid that.
Pip and Homebrew way
Homebrew can install C libraries compiled for M1. Python packages will find and use them.
Using an environment with Python 3.9
Install shapely:
brew install geos
export DYLD_LIBRARY_PATH=/opt/homebrew/opt/geos/lib/
pip install shapely
DYLD_LIBRARY_PATH is needed for shapely to find GEOS installation.
Install fiona:
brew install gdal
pip install fiona
Install pyproj:
brew install proj
pip install pyproj
Install geopandas and pygeos for speedups:
pip install pygeos
pip install geopandas
Note that this is a copy&paste of my own explanation given in https://github.com/geopandas/geopandas/issues/1816#issuecomment-1003093329.
Related https://github.com/pyproj4/pyproj/issues/1027
I was stuck with the same problem, I also tried setting the environment values for PROJ_DIR, PROJ_LIBDIR, PROJ_INCDIR but perhaps setting the values is causing the error, so closed the terminal and tried again and was able to install correctly
I created a virtual environment for my project and I'm trying to install torch via pip.
pip install torch===1.5.1 torchvision===0.6.1 -f https://download.pytorch.org/whl/torch_stable.html
This gives me the error -
ERROR: Could not find a version that satisfies the requirement torch===1.5.1 (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
ERROR: No matching distribution found for torch===1.5.1
Some solutions recommend the use of conda, is it necessary? Can I not do it through just pip
You can try to install directly from the wheels files:
pip install https://download.pytorch.org/whl/cu102/torch-1.5.1-cp36-cp36m-win_amd64.whl
pip install https://download.pytorch.org/whl/cu102/torchvision-0.6.1-cp36-cp36m-win_amd64.whl
Import error: C extension: NO MODULE NAMED TIMEDELTAS NOT BUILT. If you want to import PANDAS from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C extensions first.
I tried following things up to now but couldn't resolve this :
pip install --upgrade pip
pip install --upgrade pandas
uninstalled the existing version of pandas and installed again.
pip install Cython
Please look at the SCREENSHOT ATTACHED ABOVE SHOWS VERSION of PANDAS, NUMPY, PYTZ, SIX installed on my system.
NOTE : I'm using Python 2.7
Any help on this will be appreciated.
Thanks.
I have Anaconda 3.19.3 with Python 3.5 on a Mac. Now, I would like to install TensorFlow via pip. The installation instructions here also include setup instructions for installing TensorFlow under Python 3.3+.
So, I have executed sudo easy_install --upgrade six, no problem. When I execute sudo pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.7.0-py3-none-any.whl, after downloading the necessary packages, I get the following:
Installing collected packages: setuptools, protobuf, tensorflow
Found existing installation: setuptools 19.6.2
Uninstalling setuptools-19.6.2:
Successfully uninstalled setuptools-19.6.2
Rolling back uninstall of setuptools
Exception:
...
AttributeError: _ep_map
During handling of the above exception, another exception occurred:
...
FileNotFoundError: [Errno 2] No such file or directory: '/Users/me/anaconda/lib/python3.5/site-packages/setuptools-19.6.2-py3.5.egg'
I have left out some of the error message to save space.
What is this and, more importantly, what can I do about it?
See the answer here:
Error setuptools when installing tensorflow
In particular, you could try adding the --ignore-installed tag to the end of your pip command.
I tried installing pyfft using python -m pip install pyfft and I get
Downloading/unpacking pyfft
Downloading pyfft-0.3.8.tar.gz
Running setup.py (path:/tmp/pip_build_echeverl/pyfft/setup.py) egg_info for package pyfft
Python >=2.5 is required to use this module.
Complete output from command python setup.py egg_info:
Python >=2.5 is required to use this module.
----------------------------------------
Cleaning up...
I'm using Python 3.4.1
From the pyfft PyPI page:
THIS MODULE IS DEPRECATED. Its functionality has been moved to Reikna. The last version, 0.3.8, will remain on PyPi for backward compatibility purposes.
Reikna supports both Python 2 and Python 3. I suggest you install it instead.