I installed this python package using pip that was compatible with Python 2.7, in a windows machine. I tried newer versions of the python-docx but those ones did not download properly. Only version 0.8.7 installed successfully and so I am using it right now. I installed it using:
pip install python-docx==0.8.7
But I think it installed a 32 bit version of this package and I am using a 64 bit machine. I know this because while I tried to run my python program using this package I got the error:
Traceback (most recent call last):
File "C:/projects/engine_script/Tools/subprocess_module/create_doc.py", line 2, in <module>
from docx import Document
File "C:\Python27\lib\site-packages\docx\__init__.py", line 3, in <module>
from docx.api import Document # noqa
File "C:\Python27\lib\site-packages\docx\api.py", line 14, in <module>
from docx.package import Package
File "C:\Python27\lib\site-packages\docx\package.py", line 11, in <module>
from docx.opc.package import OpcPackage
File "C:\Python27\lib\site-packages\docx\opc\package.py", line 12, in <module>
from .part import PartFactory
File "C:\Python27\lib\site-packages\docx\opc\part.py", line 12, in <module>
from .oxml import serialize_part_xml
File "C:\Python27\lib\site-packages\docx\opc\oxml.py", line 12, in <module>
from lxml import etree
ImportError: DLL load failed: %1 is not a valid Win32 application.
This is where the package got downloaded to: C:\Python27\Lib\site-packages\lxml-3.3.5-py2.7-win32.egg
Anyone have the link to the 64 bit version (win_amd64.whl) of this package? I tried searching in this link(https://www.lfd.uci.edu/~gohlke/pythonlibs/) but could not find the package I was looking for. I even have the latest lxml package and the package is still not working as the script shows errors.
Related
I try to install dash on a mac OS, and I have the following error when running 'import dash' on a python script:
Traceback (most recent call last):
File "app.py", line 16, in <module>
import dash
File "/Users/manuel/Library/Python/3.9/lib/python/site-packages/dash/__init__.py", line 5, in <module>
from .dash import Dash, no_update # noqa: F401,E402
File "/Users/manuel/Library/Python/3.9/lib/python/site-packages/dash/dash.py", line 17, in <module>
from flask_compress import Compress
File "/Users/manuel/Library/Python/3.9/lib/python/site-packages/flask_compress/__init__.py", line 1, in <module>
from .flask_compress import Compress
File "/Users/manuel/Library/Python/3.9/lib/python/site-packages/flask_compress/flask_compress.py", line 14, in <module>
import brotli
File "/Users/manuel/Library/Python/3.9/lib/python/site-packages/brotli.py", line 8, in <module>
import _brotli
ModuleNotFoundError: No module named '_brotli'
I can't figure it out what is the problem. I use python 3.7. I saw on the internet a similar issue on windows, but not on mac. I would be really grateful if you could help me.
You seem to have a broken installation of the brotli module (missing its native code component _brotli).
Try uninstalling it with pip uninstall brotli, then reinstall it; pip install brotli.
Going forward, I would heavily recommend you learn and use virtualenvs instead of installing everything into your Python's site-packages.
After uninstalling and installing again brotli it worked! Moreover, working in virtual environments is really more appropriate. Thank you a lot, AKX.
I am running Glumpy on python 3.7.2 and windows 10. I keep getting this error EVEN AFTER installing through pip.
Traceback (most recent call last):
File "C:\Users\algeb\Downloads\Animoji-Animate-master\animate.py", line 3, in <module>
from glumpy import app, gloo, gl
File "C:\Users\algeb\AppData\Local\Programs\Python\Python37-32\lib\site-packages\glumpy\__init__.py", line 7, in <module>
from . import app
File "C:\Users\algeb\AppData\Local\Programs\Python\Python37-32\lib\site-packages\glumpy\app\__init__.py", line 16, in <module>
from glumpy.ext.inputhook import inputhook_manager, stdin_ready
File "C:\Users\algeb\AppData\Local\Programs\Python\Python37-32\lib\site-packages\glumpy\ext\__init__.py", line 6, in <module>
from . import freetype
File "C:\Users\algeb\AppData\Local\Programs\Python\Python37-32\lib\site-packages\glumpy\ext\freetype\__init__.py", line 49, in <module>
raise RuntimeError('Freetype library not found')
RuntimeError: Freetype library not found
Per discussion in the comments above, the problem seems to have been that Glumpy requires the freetype package, which requires the FreeType library to be installed. You can download Windows binaries for FreeType, e.g., here. Make sure to download the .dll for the correct platform (in your case, that would seem to be 64-Bit now). Once downloaded, place the .dll somewhere on your machine and add the path to the directory where it's located to the PATH environment variable. Then the freetype package should be able to find it. More detailed installation instructions can be found in the freetype package Readme.
For me it helped to install the Microsoft C++ Redistributable from https://visualstudio.microsoft.com/en/downloads/
I have been trying to find a solution to this import error regarding the pandas library when it says no module named "parsing." Every library should be installed correctly from the interpreter and they are all the latest version.
This is what the console returns:
Traceback (most recent call last):
File "C:\Users\shaya\PycharmProjects\NEA\venv\lib\site-packages\pandas\__init__.py", line 26, in <module>
from pandas._libs import (hashtable as _hashtable,
File "C:\Users\shaya\PycharmProjects\NEA\venv\lib\site-packages\pandas\_libs\__init__.py", line 4, in <module>
from .tslib import iNaT, NaT, Timestamp, Timedelta, OutOfBoundsDatetime
File "pandas\_libs\tslibs\conversion.pxd", line 11, in init pandas._libs.tslib
File "pandas\_libs\tslibs\conversion.pyx", line 40, in init pandas._libs.tslibs.conversion
ModuleNotFoundError: No module named 'parsing'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/shaya/PycharmProjects/NEA/Main.py", line 4, in <module>
import pandas_datareader.data as data
File "C:\Users\shaya\PycharmProjects\NEA\venv\lib\site-packages\pandas_datareader\__init__.py", line 2, in <module>
from .data import (DataReader, Options, get_components_yahoo,
File "C:\Users\shaya\PycharmProjects\NEA\venv\lib\site-packages\pandas_datareader\data.py", line 7, in <module>
from pandas_datareader.av.forex import AVForexReader
File "C:\Users\shaya\PycharmProjects\NEA\venv\lib\site-packages\pandas_datareader\av\__init__.py", line 3, in <module>
from pandas_datareader.base import _BaseReader
File "C:\Users\shaya\PycharmProjects\NEA\venv\lib\site-packages\pandas_datareader\base.py", line 7, in <module>
import pandas.compat as compat
File "C:\Users\shaya\PycharmProjects\NEA\venv\lib\site-packages\pandas\__init__.py", line 35, in <module>
"the C extensions first.".format(module))
ImportError: C extension: No module named 'parsing' not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.
All of the above tracebacks are from PyCharm.
OS: Windows.
I am using pip to install packages
Python version: 3.7.1, panda version: 0.23.4
Do you have python added to path? To test this; open a cmd and type python. If it is on your path, you should see the version of python you are running (Assuming you are using a windows machine). If this is the case, you can simply run the command after you checked this. If not, please navigate to the location where Python is installed, open python.exe and try to run the command python setup.py build_ext --inplace --force
If this doesn't work, you should try to re-install pandas by pip install --upgrade --force-reinstall pandas
If this also fails you could also go rigourous, and simply create a new environment and install pandas there. Sidenote: It is probably better to install pandas by using conda package manager, Pandas has portions of its code written in C to make it run faster. If you tried to install pandas manually you would need to build it.
I had the same problem under the same circumstances. I went through the code of some of the pandas files and saw that there is indeed a module named 'parsing' in the tslib folder of my pandas directory, yet for some reason it's not able to call it. I just reinstalled python and now it's working for me. If you find any other alternative, please let me know.
I usually code in Matlab but I found a nice piece of PYTHON code that I would like to use. However having downloaded the package it is proving difficult to run. I'm getting the following error:
Traceback (most recent call last):
File "C:\launch.py", line 29, in <module>
from src.smcsquare import SMCsquare
File "C:\src\smcsquare.py", line 32, in <module>
from scipy.stats import norm
File "C:\Python34\lib\site-packages\scipy\stats\__init__.py", line 338, in <module>
from .stats import *
File "C:\Python34\lib\site-packages\scipy\stats\stats.py", line 184, in <module>
import scipy.special as special
File "C:\Python34\lib\site-packages\scipy\special\__init__.py", line 586, in <module>
from ._ufuncs import *
ImportError: DLL load failed: The specified module could not be found.
The _ufuncs.pyd is there in the C:\Python34\lib\site-packages\scipy\special\ directory. I tried adding this to my PYTHONPATH but it made no difference. I have also tried so dll fixers but these have not helped.
Has anyone encountered this and did you find a solution?
As other have said, make sure your .whl file matches the version and 32/64bit of the python distribution you're using.
Next, the problem I was having was I forgot to download and install the extra "numpy+mkl" package per the instruction: http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
So for me it was numpy-1.11.0+mkl-cp35-cp35m-win_amd64.whl, which I downloaded and then:
python -m pip install numpy-1.11.0+mkl-cp35-cp35m-win_amd64.whl
I had already installed the regular numpy package via pip, but I just installed this one over it and everything started working and has been fine so far.
I have installed Slycot successfully on other windows machines, but I am running into an error I have not seen before while attempting to install it on my work desktop. My usual procedure is as follows:
Install PythonXY
Download Microsoft Visual C++ 2008 and SP1 using link from http://www.lfd.uci.edu/~gohlke/pythonlibs/
Download and install Slycot from binary provided in http://www.lfd.uci.edu/~gohlke/pythonlibs/
This has worked before, and it appeared to install with no issues, but I get the following error when I try to import slycot:
>>> import slycot
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\slycot\__init__.py", line 5, in <module>
from slycot.analysis import ab01nd,ab05md,ab05nd,ab07nd,ab08nd, ab09ad
File "C:\Python27\lib\site-packages\slycot\analysis.py", line 21, in <module>
from slycot import _wrapper
ImportError: DLL load failed: The specified module could not be found.
>>>
I went to the location of the source in thhe site-packages directory and indeed the _wrapper.pyd file is there. Any ideas why it can't find the DLL?
I re-installed PythonXY and followed my original procedure and the installation worked the second time around. I'm chocking it up to humidity issues (-;