pyinstaller downloaded using pip not working after installation - python

Screenshot of error
I'm trying to install a module called pyinstaller from pip to make .py files into an executable, but can't run it from command prompt. Any ideas as to why it doesn't work or workarounds with other applications that serve the same purpose?

try changing directory to where python location is and try installing again
i.e C:\Users--------------------\AppData\Local\Programs\Python\Python39> pip install pyinstaller

Related

PyInstaller on cygwin

I need to create an .exe file from a .py file on cygwin. Since py2exe doesn't seem to work there, I tried PyInstaller. However I have a problem installing it. pip install pyinstaller returns this message:
ERROR: Failed compiling the bootloader. Please compile manually and rerun setup.py
So I tried to follow this guide: https://pyinstaller.readthedocs.io/en/latest/bootloader-building.html and install it manually. But when I run pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz the folder that I get for PyInstaller is not https://github.com/pyinstaller/pyinstaller but this one: https://github.com/pyinstaller/pyinstaller/tree/develop/PyInstaller in which there are no waf files and I can't run python ./waf all.
So I downloaded the needed folder from github manually and then python ./waf all succeded. However, I still can't not use PyInstaller since I get this error when trying to call it from command line:
ModuleNotFoundError: No module named 'PyInstaller.__main__'
And I have no clue how to fix it. What should I do to get PyInstaller working or maybe I need to to use some other module that works with cygwin?

python -- manually install downloaded module without admin rights

I am trying to install the python package us without admin privileges.
I have tried pip install us in Anaconda prompt to no avail.
I have also tried the suggestion listed here: Install python modules on windows without admin rights--didn't work.
I have now downloaded the files from the site https://pypi.org/project/us/ to my desktop and need to know how to install the package from here.
I am using the Spyder IDE and Python 3.7. Is there a way to do this?
Thanks.
I do this on the daily and if I understand what you are saying you are doing it right. If pip install us in command prompt or shell (if you are using Windows OS) doesn't work try py -m pip install us. Make sure you are using command prompt and not using your IDEz
As you can see it worked first try for me.
Since you have downloaded the files, Extract them in a folder and normally a setup.py file must be include, open command prompt in that folder and run :
python setup.py install

Pyinstaller command not found (MacOS)

I've been trying to use PyInstaller on my program, scratch_1.py. The PyCharm project folder is called "idigen", which is saved in my desktop. So, I changed the director like so:
cd /Users/joelsaarinen/Desktop/idigen
then, moved on to use pyinstaller, and I get this error:
pyinstaller scratch_1.py
-bash: pyinstaller: command not found
I'm confused because when I use:
pip show pyinstaller
to verify that I have pyinstaller installed, it returns a positive result.
Is there an additional command I should be putting in when using Pyinstaller on one of my files? Might this be an issue with this specific program or the operating system in general? Thanks in advance.
This is a common problem due to the fact that you might install a different version of python and keep using an old version that is preinstalled in the machine. Here is the best solution.
First, check the version of the python that you installed. In my case, i installed python 3.5 and the machine had python2.7. If you run python on the terminal, most likely the preinstalled one is the one that will run.
Second, check the directory of your desired python version. watch -a python3 is the command to run to see your directory.
Third, set the directory as the main one to run your python commands.
alias python=/usr/local/bin/python3 does the whole trick
Lastly, reinstall pip. Download the get-pip.py file and run sudo /usr/local/bin/python3 get-pip.py * I used the path to show the reason we updated the alias*
Now you can run pyinstaller without problems
pyinstaller appears to have installed correctly, but the command is not available on PATH. You need to locate where the executable was placed.`below to find executables
set | grep pyinstaller
now modify path by this
export PATH=some_path:another_path
launchctl setenv PATH $PATH
I just downloaded the source code of pyInstaller from official website, put it where I can find it and wrote a script which launches pyinstaller.py from that folder.
For some reason, pyinstaller.py is missing in the pyInstaller installation downloaded via pip.
I had the same issue on MacOS with Developer Tools 11.4 and found two ways to start pyinstaller:
alt 1: path based solution
$ pip3 show -f pyinstaller|grep pyinstaller
will find pyinstaller in a bin path:
../../../../usr/local/bin/pyinstaller
...
So you can use one of the set-the-path-or-an-alias approaches or call via fully qualified path.
alt 2: call via python module
$ pip3 show -f pyinstaller|grep __init__
will get you a hint on how pyinstaller is defined as a module:
PyInstaller/__init__.py
...
With that capitalization, it's possible to call pyinstaller as a module with the following:
$ python3 -m PyInstaller --version
4.2
I'm using the latter now.

How to install library with pip-console?

I downloaded some python library package (for example uncompile2) from GitHub. How I can install it into Qpython from the directory in my android device with pip-console? Or at least to try install...
You could install it directly through pip console, just type "pip install "
Or, you can make a .sh file with contents
python /your/path/to/the/package/setup.py install
Or at least I think so.
You could copy the modules you want installed into the site-packages folder
using a file manager open up the folder:
/sdcard/com.hipipal.qpyplus/lib/python2.7/site-packages/
that is where you can put the modules, i have not tried it with the pip console.

pyinstaller --version failed to create a process

I would like to use PyInstaller to create a Windows executable. I installed pyinstaller using pip, as well as the correct version of pywin32.
When I attempt to verify the pyinstaller installation by typing pyinstaller --version, I get the message failed to create a process.
What am I doing wrong? Thanks in advance for your help.
There could be two reasons:
1) The python install location has spaces. See the answer at https://stackoverflow.com/a/34546220/3559967
2) You renamed the python install location. See the answer at https://stackoverflow.com/a/17560177/3559967
You can always reinstall pyinstaller:
python -m pip uninstall pyinstaller
[output of uninstall]
python -m pip install pyinstaller
where python is the command you use to run the python version of your choice (py, python, python3, etc.).
Notes:
Moving or changing exe names (i.e. the python.exe filename), folders, etc. can cause issues, per the other answer. If you want to make changes to the python exe or it's location, you typically need to do that immediately upon install, before installing any other packages.
There are ways of recording all your existing packages (See PIP Freeze) to a requirements.txt file, and then reinstalling them later, for another version of Python or to a new virtual environment.
If you are not familiar with virtual environments, you can start learning in the Python venv package docs. Note that you should never rename or move a venv folder after creating it (but it's easy to create a new one and reinstall the packages).

Categories

Resources