Import Error : C Extension while generating windows executable of a Python script using PyInstaller - windows

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.

Related

Cannot import 'etree' from 'lxml'

I have installed lxml on my Windows machine using
pip install lxml
However, if I run
from lxml import etree
or
from requests_html import HTMLSession
I get
cannot import name 'etree' from 'lxml' (C:\Users\user\AppData\Local\Programs\Python\Python39\Lib\site-packages\lxml\__init__.py)
I have uninstalled and reinstalled lxml many times through pip and it installs successfully every time. I can see folders lxml and lxml-4.6.2.dist-info getting installed in site-packages every time I reinstall. I don't have any lxml.py files in this directory either.
Do you also have Anaconda installed ? If you have both Python and Anaconda installed, there are two directories for the site-packages (one for Python and another for Ananconda), which could cause an error when trying to import.
You can try the following steps below and then run your program again:
Uninstall Anaconda from your machine
pip uninstall lxml
pip install lxml

No module named pymc3

HI i'm trying to import pymc3 after pip installing it from the command line within the library where Python.exe sits in. (i.e. >>python -m pip install pymc3). after checking the Lib/Site-Packages library, there's no pymc3, but there is a theanos package installed though. i've looked everywhere for the pymc3 package but can't find it. i've tried installing pymc4 and same thing happens. any idea why?
You should be able to run pip straight for command line.
IE: the command is "pip install pymc3"
Then you would need to import it.
Your issue might also be that you recently installed python and have pip3 installed and not pip. You can check if pip vs pip3 is installed with pip --version and pip3 --version.
Whichever one of those responds with some form of pip XX.X.X from /.... would be the command you need to run.
If you do have pip3 then the command to run from the command line would be "pip3 install pymc3"
Are you able to do
import pymc3
in a Python script? If so, you can find out where it's installed with
print(pymc3.__file__)

Can't importe scikit-image in python 3.7

I have successfully installed the package scikit-image in my python project. However, I can't seem to import it to my python code. It seems it has a problem with the hyphen in the package. I have tried to install skimage, but it pip does not want to install this package and suggest I should install scikit-image instead. Does anyone know how I can solve this problem?
To install:
pip install scikit-image
To check which version is installed:
pip show scikit-image
To use in Python:
import skimage
or, something more specific:
from skimage.morphology import skeletonize
If that doesn't work, run each of the following commands and paste the output into your question:
which pip
pip -V
which python
python -V

Python can't find or install lxml

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"

Python pip not working for scipy, scikit-learn and gensim

I'm trying to install scipy, scikit-learn, and gensim on Windows 7 with Python 3.3.
If I try any of these:
pip install sci
pip install scipy
pip install scikit-learn
pip install gensim
I end up with an ImportError similar to:
ImportError: no module named numpy
And yes, I have installed numpy - it works fine if I try to import it in Python. I've managed to install scipy and scikit-learn by downloading executable installers, but gensim doesn't have one...
I've also tried using easy_install for all three, but that doesn't work either.
Is it something to do with the Python installation? Any ideas? Thanks a lot in advance!

Resources