I have installed Python 3.5.0rc3 amd64 and I need to install Pillow. So I downloaded it from http://www.lfd.uci.edu/~gohlke/pythonlibs/ Pillow‑2.9.0‑cp35‑none‑win_amd64.whl and I've also installed by pip successfully. But when I'm typing in interpreter from PIL import Image I got the following message:
File "C:\Program Files\Python 3.5\lib\site-packages\PIL\Image.py", line 63, in <module>
from PIL import _imaging as core
ImportError: DLL load failed: The specified module could not be found.
Moreover when I uninstalled this package and I was trying to install by easy_install I got another error:
Couldn't find a setup script in C:\Program Files\Python 3.5\Scripts\Pillow‑2.9.0‑cp35‑none‑win_amd64.whl.
What can I do?
Try this command on the command line:
python -m pip install pillow
Related
I am trying to download the package rasterio for analyzing raster datasets in python within the geospatial analysis disciplines.
I have downloaded the package dependencies for rasterio, including gdal, pyproj, and fiona via the wheel files from this geospatial analysis binaries resource: https://www.lfd.uci.edu/~gohlke/pythonlibs/
I installed these packages through pip.
I then downloaded from this resource the wheel file rasterio through pip.
I received the following message from Window Command Prompt after installing rasterio: Successfully installed affine-2.3.0 numpy-1.21.4 pyparsing-3.0.6 rasterio-1.2.10 snuggs-1.4.7.
I want to use this package in Jupyter Notebook, and so I open a Jupyter Notebook file and run import rasterio, and receive this error message:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-17-350e27267e59> in <module>
----> 1 import rasterio
~\Anaconda3\lib\site-packages\rasterio\__init__.py in <module>
15 from pathlib import Path
16
---> 17 from rasterio._base import gdal_version
18 from rasterio.drivers import driver_from_extension, is_blacklisted
19 from rasterio.dtypes import (
ImportError: DLL load failed: The specified module could not be found.
How can I address this "DLL load failed" issue and address this error so that I can use rasterio? I was told this could be an issue of not having Visual C++ installed on my computer, and so I installed Visual Studio 2022 on my computer, but this did not help.
I solved this problem with the following steps:
I created a fresh environment
I installed the gdal library (since rasterio is built on top of it), with the command:
conda install -c conda-forge gdal
I installed rasterio with the command:
conda install -c conda-forge rasterio
I have installed python 3.7 and want to do some forecasting using fbprophet (https://facebook.github.io/prophet/docs/installation.html#python)
But I get this error when installing the package using the command (pip install fbprophet)
import pystan
File "e:\repos\usf\venv\lib\site-packages\pystan\__init__.py", line 9, in <module>
from pystan.api import stanc, stan
File "e:\repos\usf\venv\lib\site-packages\pystan\api.py", line 13, in <module>
import pystan._api # stanc wrapper
ImportError: DLL load failed: The specified module could not be found.
I have done some research and got to know that this is possible with conda. But I am looking for a solution without using conda.
Thanks in advance.
It says in the Pystan documentation that configuring a C++ compiler can be challenging on Windows. Following approach worked for me to install Pystan 2.17.1 and FBProphet 0.6:
Install C++ compiler, mingw-w64 (http://mingw-w64.org/doku.php/download) -> I selected this one https://sourceforge.net/projects/mingw-w64/files/
Add C:<MinGW_w64 installation directory>\bin to the PATH environment variable
Create a distutils.cfg file with the following contents in the folder \Lib\distutils in Python install directory (in venv):
[build]
compiler=mingw32
[build_ext]
compiler=mingw32
pip install numpy cython
pip install pystan==2.17.1
Verify the Pystan installation (https://pystan.readthedocs.io/en/latest/windows.html)
pip install fbprophet==0.6
Follow https://github.com/facebook/prophet/issues/1939
I had similar issues even after installing Mingw
conda install libpython m2w64-toolchain -c msys2
Solved all the errors and i am able to install fbprophet finally
Thanks
I had similar issues with my Python3.6 (anaconda)
I reinstalled anaconda for all users (with admin privileges) then
"conda install -c conda-forge pystan"
later i updated all other modules
it works without any error now
The below shows me trying to run my code with a response that the MagickWand shared library is not found and that imagemagick library is not installed. So I try to install, but it shows it's already installed? Any advice for next steps to trouble shoot?
python /Users/osx/Downloads/pdf_manage/main.py
Traceback (most recent call last):
File "/Users/osx/Downloads/pdf_manage/main.py", line 3, in <module>
from src.pdf_utils import PdfUtils
File "/Users/osx/Downloads/pdf_manage/src/pdf_utils.py", line 5, in <module>
from wand.image import Image as WandImage
File "/usr/local/lib/python2.7/site-packages/wand/image.py", line 20, in <module>
from .api import MagickPixelPacket, libc, libmagick, library
File "/usr/local/lib/python2.7/site-packages/wand/api.py", line 206, in <module>
'Try to install:\n ' + msg)
ImportError: MagickWand shared library not found.
You probably had not installed ImageMagick library.
Try to install:
brew install freetype imagemagick
osx:~ osx$ brew install imageMagick
Warning: imagemagick 7.0.7-26 is already installed
osx:~ osx$ brew install freetype
Warning: freetype 2.9 is already installed
UPDATE- Running the below fixed my issue:
ln -s /usr/local/Cellar/imagemagick#6/6.9.9-38/lib/libMagickWand-6.Q16.dylib /usr/local/lib/libMagickWand.dylib
I have pygame 1.9.2 for Python 3.2+. However, when I try to start up Python with pygame, I receive: "ImportError: DLL load failed: The specified module could not be found." I found the files it needs, but where should I put them?
This is my full error traceback:
Traceback (most recent call last):
File "C:\Users\Owner\AppData\Local\Programs\Python\Python36-32\hg.py", line 1, in <module>
import pygame
File "C:\Users\Owner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pygame\__init__.py", line 95, in <module>
from pygame.base import *
ImportError: DLL load failed: The specified module could not be found.
Most pygame errors in windows 10 are caused by having an out-of-date pygame by installing the compiled .exe version while not installing it from the official source, since their version is different from the PyPi index.
You will have to download the corresponding file suitable for your system from here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame
Then do
pip install c:/path/to/the/wheelfile.whl
You must have installed pygame incorrectly or something went wrong during installation. I would uninstall pygame and reinstall it with the pip command.
Go to the search bar at the bottom left of your desktop (on your taskbar) and enter cmd. This will open the command line interface (CLI). Then go to here: https://pip.pypa.io/en/stable/installing/ and install the file get-pip.py. Once this has been completed, go to the cmd you opened earlier and enter python get-pip.py. This should install pip, setuptools and wheel.
After this, use the command below to install pygame:
pip install pygame
Then try a simple test to see if it works:
import pygame
print(pygame)
I'm on a macbookpro 10.6.8 and I get this error message when trying to use ghostscript:
Traceback (most recent call last):
File "/Users/arnoutaertgeerts/Documents/Eclips/SlideTalk 2.0/slidetalk.py", line 13, in <module>
import ghostscript
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ghostscript-0.4.1-py2.7.egg/ghostscript/__init__.py", line 33, in <module>
import _gsprint as gs
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ghostscript-0.4.1-py2.7.egg/ghostscript/_gsprint.py", line 290, in <module>
raise RuntimeError('Can not find Ghostscript library (libgs)')
RuntimeError: Can not find Ghostscript library (libgs)
Installed the package with:
pip install ghostscript
For newer user who are using M1 mac, ghostscript might show a missing libgs file error and the file would be unavailable at usr/local/lib
The issue can be resolved by following these steps, in the same order:
brew install ghostscript
conda install ghostscript, which installs the arm_64 based library from conda-forge
If conda throws a channel error try using conda install -c conda-forge ghostscript
pip install ghostscript
Note:
The libgs.dylib file can be found in the home brew installation of ghostscript
Changing the address in _gsprint.py will throw an error as the brew installed version will be arm_64 based and the pip installed version will be OS_X86 based
Python doesn't recognise ghostscript module from conda install unless pip install is run, so that is an essential step
How are you trying to 'use' Ghostscript ? This seems to be an error from Python which can't find libgs (I do not speak Python I'm afraid)
I'm not certain that libgs is is included in the Mac installation but if it is, then libgs should be in the Ghostscript folder. Have you checked to see if it is present ?
If it is, then the most likely problem is that its not in the search path, I have no idea how searches are resolved on a Mac though.
The ctypes.find_library searches in /urs/local/lib.
I added this path to my ghostscript module:
/opt/local/lib/libgs
I changed the path for libgs in the file "_gsprint.py" and it works~
Instead of libgs.so (libgs = cdll.LoadLibrary("libgs.so"), I used
libgs = cdll.LoadLibrary("Corresponding_Path_in_my_laptop/libgs.dylib").
Ps: There's no libgs.so on my Mac, only one libgs.dylib file.
Thanks #KenS and #arnoutaertgeerts!