I'm trying to create a .exe file com a .py file using auto-py-to-exe, that uses pyinstaller for creating the file.
The problem is, on codes that I import the sklearn lib, I get the following error on opening the output exe file:
enter image description here
I have already tried including hidden imports from sklearn, cx-freeze, sklearn.neighbors.typedefs','sklearn.neighbors.quad_tree','sklearn.tree._utils' and sklearn.utils._cython_blas.
Also tried one file and one directory, both with same problem.
Also tried directly using pyinstaller, with same error. It works fine on codes without sklearn. Tried on python versions 3.6, 3.7 and 3.8.
Does anyone have a glue on how to solve this problem?
Thank you.
Related
So I imported the sklearn module into my python script, which runs fine when executing from the terminal; but I wanted to turn it into an executable using PyInstaller, to which I used the following command: pyinstaller.exe --onefile MainApp.py. Now when I try to run my executable I get a missing dll file error; Note that this worked fine before I imported sklearn, which makes me think this is a problem with sklearn module.
I uninstalled and reinstalled said module but it did not work.
It is also interesting to note that the _MEI57882 folder does not exist in my my Temp folder
Update
I've also run across instances of other people facing the same problem: https://github.com/scikit-learn/scikit-learn/issues/15899, but it sounded like they were trying to fix the problem with the install, back in 2019. I have the latest sklearn module to date so I'm still running into the problem.
Bigger Update
After talking with some contributes of scikit-sklearn, this error appears to be on the side of py-installer; not the module itself.
I have written a python script that uses cvlib library, when i run the code as a python scrept it works fine, however; when i converted the code into an exe file, everything seems to work fine, apart from importing cvlib library.
The error shows up like the follwoing:
pkg_resources.DistributionNotFound: The 'cvlib' distribution was not found and is required by the application
The detailed Error
Has anyone face this problem before ? if so, could you please provide me the proper way of fixing it as i think there are some dependencies issue.
I figured out finally what the problem was, Pyinstaller sometimes is not able to include some libraries that we import in our (.py) file. So, When Pyinstaller creates the (.exe) file, it agnores some imports, so the solution is to copy the folder of these imports, For example, cvlib forlder and paste it as it is in the same location as your (.exe) file.
I am trying to convert my .py file to an exe file. I've done it in the past but for some reason it isn't working anymore. I am using Python 2.7 and have other versions installed as well but my application won't work without 2.7. If I do python activityKivy.py it runs perfectly. I also tried with py2exe but was unsuccessful, it gave me too many dll warnings and would crash each time I open it. I prefer to stick with pyinstaller because thats what always worked for me. Some help would greatly be appreciates!
error screenshot
**Update: I wasn't able to figure out exactly what the problem was but I was playing around with my environment variables and changing my pip names to pip2 pip3 and thats when this problem started happening and even when I reverted all my changes it still showed me this.I was able to fix it by simply uninstalling pyinstaller and redownloading it.
Preface: I am using Python 3.6.5, Tensorflow 1.4.0, and Unity Ml-Agents v0.3
I am using tensorflow(1.4.0) along with the Unity Ml-Agents git repository. In tensorflow there is a file called saved_model_utils.py that needs to import reader.py from a different file directory within the tensorflow package. My issue is that when I run the training program it fails at the import line in saved_model_utils.py. I have tried multiple different ways of specifying a direct path to file for the import but none of them satisfied the issue. I assume there is something I don't know that is making this difficult because it doesn't make sense that tensorflow would put a faulty script in there package. Any help is appreciated!
Here is a picture of the saved_model_utils.py:
saved_model_utils.py with reader.py highlighted in the project window
Here is a picture of the terminal and error when I run the scripts:
Terminal Error
Looking at the file paths, it seems like there's inconsistency in the folder names. I tried
from tensorflow.contrib.saved_model.python.saved_model import reader
and it's working. If you look at the file path in your first image, it's "saved_model" rather than "saved_models".
Hope this can fix your problem.
I am novice in python and Simple_ITK both to process .mha 3D image files. I have two problems:
When ever I install ITK, I always get an error as shown below:
and somehow I install ITK It doesn't work at all having no connectivity with python. And I also tried python-insighttoolkit3 package then it shows and error of
" Can't down load Python 2.8:i386" in Ubuntu software Center. I have tried various methods to install Insight Tool Kit in Ubuntu whatever I found but most of the time I get the same error as shown in picture above.
So can anybody guide me how to install and build ITK so that no error like no module named itk found.
Now another problem is I have a .py file and it has a class in which I have to fed input externally otherwise it will consider as None. SO I tried to call the file as
import /path/to/file/xxx.py
but it gives an Syntax error: invalid syntax
so how to call class from a python file from python Console .
Now, I'm using Ubuntu 15.02. For any missing details please ask.
Thanks.
1- For what I see in the image, I see that you are trying to install ITK instead of SimpleITK. For SimpleITK it is very simple using a linux package installer, like pip or easy-install. in this link you have the instructions to install it correctly. Remember to execute the instructions as super user. Maybe it is the reason of your error ( I can't see the instruction you are writing in the console ).
2- I recommend you to read the Python tutorial for modules The fastest way is to be located first on the directory of your .py file. The sequence would be:
cd /path
import module.py