Does anybody know what could cause this error with python?
I have scipy installed but when I try to use scipy.stats it complains that "image not found"
Turns out the DMG file I used for my python (form NASA's stsci) is missing gfortran
Related
I have installed the PILLOW module in Windows 8.1 for Python 3 using the below command.
pip install pillow
The installation was a success.
Unfortunately when I tried to import the image sub-module within it using the below statement I got an import error.
from PIL import image
Error: ImportError: cannot import name 'image' from 'PIL' (C:\Program Files\Python38\lib\site-packages\PIL_init_.py)
Although the below statement is giving me an error for the 'PIL' .
image = PIL.Image.open("Capture Image.PNG")
Error: Undefined variable: ' PIL'Python(undefined-variable)
I have tried similar posts listed below, but they didn't help me to solve the issue.
Pip install Pillow: "no module named Pillow?"
Pillow installed, but getting "no module named pillow" when importing
Python pillow module not importing properly
Could you please someone explain what I'm missing here?
Regards,
Chiranthaka
#dragon2fly Many thanks for solving the issue. Please refer the below snippet for the complete source code.
from PIL import Image
image = Image.open("Capture_image.png")
print(image.size)
So I trying to install and run from MSFT the cntk, you know, just for fun. Anyway, I keep getting this error which says:
import numpy as np
ModuleNotFoundError: No module named 'numpy'
Now I have looked around here a little and I found a post saying that I needed to install the latest version of NumPy, but when I go to do that, I get back this:
Requirement already satisfied: NumPy in c:\users\username\appdata\local\continuum\anaconda3\envs\cntk-py34\lib\site-packages
SO I really have no idea what is going on here.
Anyway, thanks in advance.
Is your IDE linked to Anaconda env? If you open up the Anaconda prompt and import numpy do you get the same error?
You probably have an environment outside of Anaconda which does not have numpy installed.
In my case, I was executing [filename].py from the Anaconda prompt as I would a batch file and was getting this error. I confirmed numpy was install by executing pip list.
Funning python and passing the script file name as an argument, eg python [filename].py, correctly imported the numpy module and executed the script without error.
i'm using cx_Freeze for the first time, and i'm facing an issue with numpy.
after i build the application with cx_freeze, whene i run the .exe file, i got this error in the image
i'm using numpy in my software, and obviously that's what make the problem, i wrote a litte software that uses numpy just for testing, and i built the .exe, and it gives me the same error, any help please ?
I suggest posting your setup.py but guessing based on a similar error I had previously, check that you have included numpy in the build_exe_options["packages"].
I am trying to compile a python 3.5 program, which uses tkinter as a GUI. To do that I am using pyinstall, but I run into a problem during compliation process I get warning messages" tkinter not found" and the program does not work afterwards (as a dist version). It seems pyinstaller is looking for tkinter.py but from what I undersant python 3.x uses __init__py. How should I proceed compiling this program? I have ran through the documentation on pyinstaller page, but it wasn't helpful, or I missed something...
enter image description here
You probably need the hidden import feature when compiling. Add the following as an option when compiling your script:
--hidden-import tkinter
i am trying to create an executable from my python script. My script runs fine, but after freezing it, starting the .exe gives me the following error:
http://www.bild.me/bild.php?file=4663406scipyerror.png
I am using Python 3.2.3, Scipy 0.12.0b1, Numpy 1.7.0 and Matplotlib 1.2.0 (all 32bit).
Any ideas/hints on how to solve this? My guess is i have to include something manually in my freezing script, but i am running out of guesses :-(
I got it finally to work, but I am very unsatisfied with my solution:
1) copy _odepack.pyd and odepack.py from the SciPy package to my program folder
2) in odepack.py change from . import _odepack to import _odepack (otherwise ValueError: Attempted relative import in non-package is raised)
3) in my main change from scipy.integrate import odeint to from odepack import odeint
Now it is working as expected and after using cx_freeze it is still working.
Still got no idea why it would not work before :-(
Thanks ThomasK for pushing me in the right direction though :-)
I finally got around this vode-problem by specifying "scipy.integrate.vode" as an include in the cx setup-file. This resulted in a file "scipy.integrate.vode.pyd" to end up in the build folder. I am using SciPy 0.11, Python 3.2.3 and the latest cx on Windows.
But adding such a "scipy.integrate.vode" file manually to the build folder would not fix the problem for me either, even though such manual-include-fixes were needed for many other .pyd files cx could not find either (and whereby the above setup.py include-solution would not work instead)...
Thanks for sharing your distress and wisdom, would not have managed to freeze my program otherwize...