I am using Mac OS Big Sur and Python 3.7. I am trying to create an executable file from my python script with pyinstaller, but my python interpreter could not find pyinstaller even though it seems to be installed.
$ /usr/local/bin/python3.7 -m pyinstaller
/usr/local/opt/python/bin/python3.7: No module named pyinstaller
Here you can see pyinstaller is installed.
$ /usr/local/bin/python3.7 -m pip list
Package Version
------------------------- -------
altgraph 0.17.2
appdirs 1.4.4
colour 0.1.5
distlib 0.3.1
filelock 3.0.12
importlib-metadata 3.7.0
macholib 1.16
pip 19.1.1
pyinstaller 5.2
pyinstaller-hooks-contrib 2022.8
setuptools 41.0.1
six 1.15.0
tkmacosx 1.0.5
typing-extensions 3.7.4.3
virtualenv 20.4.2
wheel 0.33.4
zipp 3.4.0
$ /usr/local/bin/python3.7 -m pip install pyinstaller
Requirement already satisfied: pyinstaller in /usr/local/lib/python3.7/site-packages (5.2)
Requirement already satisfied: altgraph in /usr/local/lib/python3.7/site-packages (from pyinstaller) (0.17.2)
Requirement already satisfied: pyinstaller-hooks-contrib>=2021.4 in /usr/local/lib/python3.7/site-packages (from pyinstaller) (2022.8)
Requirement already satisfied: importlib-metadata; python_version < "3.8" in /usr/local/lib/python3.7/site-packages (from pyinstaller) (3.7.0)
Requirement already satisfied: setuptools in /usr/local/lib/python3.7/site-packages (from pyinstaller) (41.0.1)
Requirement already satisfied: macholib>=1.8; sys_platform == "darwin" in /usr/local/lib/python3.7/site-packages (from pyinstaller) (1.16)
Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/site-packages (from importlib-metadata; python_version < "3.8"->pyinstaller) (3.4.0)
Requirement already satisfied: typing-extensions>=3.6.4; python_version < "3.8" in /usr/local/lib/python3.7/site-packages (from importlib-metadata; python_version < "3.8"->pyinstaller) (3.7.4.3)
Any help is greatly appreciated!
Pyinstaller has a console_scripts entry point. So you can directly run from the console.
Instead of /usr/local/bin/python3.7 -m pyinstaller , just run pyinstaller command directly, eg: pyinstaller --version
If you are using virtual environment, activate that first before running pyinstaller commands.
You can also run it by using PyInstaller instead of using pyinstaller.
Eg: /usr/local/bin/python3.7 -m PyInstaller --version
Related
My goal is to work with Twitter API and do a sentiment analysize on tweets.
I am Working on a MAC, with VS Code on Anaconda.
I followed the tutorial and installed: python3 -m pip install --user virtualenv in my Terminal:
(base) Ludwigs-MBP:~ ludwigmehmke$ python3 -m pip install --user virtualenv
Requirement already satisfied: virtualenv in ./.local/lib/python3.7/site-packages (20.4.3)
Requirement already satisfied: six<2,>=1.9.0 in /opt/anaconda3/lib/python3.7/site-packages (from virtualenv) (1.12.0)
Requirement already satisfied: filelock<4,>=3.0.0 in /opt/anaconda3/lib/python3.7/site-packages (from virtualenv) (3.0.12)
Requirement already satisfied: distlib<1,>=0.3.1 in ./.local/lib/python3.7/site-packages (from virtualenv) (0.3.1)
Requirement already satisfied: appdirs<2,>=1.4.3 in ./.local/lib/python3.7/site-packages (from virtualenv) (1.4.4)
Requirement already satisfied: importlib-metadata>=0.12; python_version < "3.8" in /opt/anaconda3/lib/python3.7/site-packages (from virtualenv) (0.23)
Requirement already satisfied: zipp>=0.5 in /opt/anaconda3/lib/python3.7/site-packages (from importlib-metadata>=0.12; python_version < "3.8"->virtualenv) (0.6.0)
Requirement already satisfied: more-itertools in /opt/anaconda3/lib/python3.7/site-packages (from zipp>=0.5->importlib-metadata>=0.12; python_version < "3.8"->virtualenv) (7.2.0)
(base) Ludwigs-MBP:~ ludwigmehmke$
(base) Ludwigs-MBP:~ ludwigmehmke$
This is what I get. Next step was to create a Virtual Machine in VS Code. I entered the terminal there and created following code:
Ludwigs-MBP:Python ludwigmehmke$ python3 -m venv venv
Error: [Errno 1] Operation not permitted
I am following this tutorial: https://fastmachinelearning.org/hls4ml/setup/QUICKSTART.html
when I give the command:
root#ubuntu:~/Desktop/vivado/hls4ml/example-models$ hls4ml convert -c keras-config.yml
hls4ml: command not found
What should I do? I tried
pip install hls4ml
I get this:
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: hls4ml in /home/mojito/.local/lib/python2.7/site-packages (0.2.0)
Requirement already satisfied: numpy in /home/mojito/.local/lib/python2.7/site-packages (from hls4ml) (1.16.6)
Requirement already satisfied: six in /home/mojito/.local/lib/python2.7/site-packages (from hls4ml) (1.14.0)
Requirement already satisfied: pyyaml in /home/mojito/.local/lib/python2.7/site-packages (from hls4ml) (5.3.1)
Requirement already satisfied: h5py in /home/mojito/.local/lib/python2.7/site-packages (from hls4ml) (2.10.0)
Requirement already satisfied: onnx>=1.4.0 in /home/mojito/.local/lib/python2.7/site-packages (from hls4ml) (1.6.0)
Requirement already satisfied: typing>=3.6.4; python_version < "3.5" in /home/mojito/.local/lib/python2.7/site-packages (from onnx>=1.4.0->hls4ml) (3.7.4.1)
Requirement already satisfied: protobuf in /home/mojito/.local/lib/python2.7/site-packages (from onnx>=1.4.0->hls4ml) (3.11.3)
Requirement already satisfied: typing-extensions>=3.6.2.1 in /home/mojito/.local/lib/python2.7/site-packages (from onnx>=1.4.0->hls4ml) (3.7.4.1)
Requirement already satisfied: setuptools in /home/mojito/.local/lib/python2.7/site-packages (from protobuf->onnx>=1.4.0->hls4ml) (44.1.0)
Try this:
$ git clone https://github.com/hls-fpga-machine-learning/hls4ml.git
$ cd hls4ml/
$ pip install .
Git repo: https://github.com/hls-fpga-machine-learning/models .
Also you can use pip as a module: $ python -m pip <command> [options]
I am trying to install rasa NLU using 'pip install rasa' command. The installation ends up with the compatibility error.
Kindly some one into the issue and help me out in resolving the version incompatible issue.
Error:
C:\Users\Desktop\RASA NLU>pip install rasa
Requirement already satisfied: h5py in
c:\users\appdata\local\continuum\anaconda3\lib\site-packages (from
keras-applications>=1.0.6->tensorflow~=1.13.0->rasa) (2.9.0)
Requirement already satisfied: asn1crypto>=0.21.0 in
c:\users\appdata\local\continuum\anaconda3\lib\ site-packages (from
cryptography->python-telegram-bot~=11.0->rasa) (0.24.0)
Requirement already satisfied: click>=5.1 in
c:\users\appdata\local\continuum\anaconda3\lib\site-packages (from
flask~=1.0->rasa-sdk~=1.0.0rc4->rasa) (7.0)
Requirement already satisfied: itsdangerous>=0.24 in c
:\users\appdata\local\continuum\anaconda3 \lib\site- packages (from
flask~=1.0->rasa-sdk~=1.0.0rc4->rasa) (1.1.0)
Requirement already satisfied: Jinja2>=2.10.1 in
c:\users\appdata\local\continuum\anaconda3\lib\site-packages (from
flask~=1.0->rasa-sdk~=1.0.0rc4->rasa) (2.10.1)
Requirement already satisfied: pycparser in
c:\users\appdata\local\continuum\anaconda3\lib\site-packages (from
cffi>=1.11.5->gevent~=1.4->rasa) (2.19)
Requirement already satisfied: docutils<0.16,>=0.10 in
c:\users\appdata\local\continuum \anaconda3 \lib\site-packages (from
botocore<1.13.0,>=1.12.146->boto3~=1.9->rasa) (0.14)
Requirement already satisfied: MarkupSafe>=0.23 in
c:\users\appdata\local\continuum\anaconda3\lib\site-packages (from
Jinja2>=2.10.1->flask~=1.0->rasa-sdk~=1.0.0rc4->rasa) (1.1.1)
**ERROR: mxnet 1.3.1 has requirement numpy<1.15.0,>=1.8.2, but you'll have numpy 1.17.4 which is incompatible.
ERROR: mxnet 1.3.1 has requirement requests<2.19.0,>=2.18.4, but
you'll have requests 2.22.0 which is incompatible.
ERROR: rasa-x 0.22.1 has requirement rasa~=1.4.0, but you'll have rasa
1.0.9 which is incompatible.
ERROR: rasa-x 0.22.1 has requirement sanic~=19.6, but you'll have
sanic 19.3.1 which is incompatible.
ERROR: apixu 0.3.0 has requirement requests==2.21, but you'll have
requests 2.22.0 which is incompatible.**
Installing collected packages: requests Found existing installation:
requests 2.21.0
Uninstalling requests-2.21.0:
Successfully uninstalled requests-2.21.0 Successfully installed
requests-2.22.0
First of all please check your python version it's must be > 3.5
Then Please try your installation with --extra-index-url params
For Installation
sudo python3 -m pip install --extra-index-url rasa
For Upgrade to latest version
sudo python3 -m pip install --extra-index-url rasa --upgrade
Still you can comment here for other errors.
I have not seen this issue in my google searches. I am trying to install PyInstaller on my work Mac which I do not have administrative access.
$ pip install --user pyinstaller
Collecting pyinstaller
Requirement already satisfied: dis3 in ./Library/Python/2.7/lib/python/site-packages (from pyinstaller)
Requirement already satisfied: setuptools in ./Library/Python/2.7/lib/python/site-packages (from pyinstaller)
Requirement already satisfied: macholib>=1.8 in ./Library/Python/2.7/lib/python/site-packages (from pyinstaller)
Requirement already satisfied: pefile>=2017.8.1 in ./Library/Python/2.7/lib/python/site-packages (from pyinstaller)
Requirement already satisfied: altgraph>=0.15 in ./Library/Python/2.7/lib/python/site-packages (from macholib>=1.8->pyinstaller)
Requirement already satisfied: future in ./Library/Python/2.7/lib/python/site-packages (from pefile>=2017.8.1->pyinstaller)
Installing collected packages: pyinstaller
Successfully installed pyinstaller-3.3.1
The install seems successful, however...
$ pyinstaller
-bash: pyinstaller: command not found
I checked my PATH
$ echo $PATH
/usr/local/git/current/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/share/dotnet:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/jc/Library/Python/2.7/lib/python/site-packages
What am I missing here?
Thanks for reading.
I had to install the tar.gz file from here:
http://www.pyinstaller.org/downloads.html
Then it can be run from the extracted folder.
$ python pyinstaller.py script.py
On my Mac pip installed the binary in /Users/%Username%/Library/Python/2.7/bin. If you add that to your PATH it should work.
I'm following the mkdocs setup process here: http://www.mkdocs.org/#installation
I'm not able to get mkdocs to do anything past the install on my local machine. I've installed the latest python and pip. I've verified the mkdocs package is installed, but still nothing:
$ mkdocs --version
-bash: mkdocs: command not found
$ python --version
Python 2.7.10
$ pip --version
pip 8.0.2 from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (python 2.7)
$ which python
/usr/local/bin/python
$ pip install mkdocs --upgrade
Requirement already up-to-date: mkdocs in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Requirement already up-to-date: Markdown>=2.3.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from mkdocs)
Requirement already up-to-date: livereload>=2.3.2 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from mkdocs)
Requirement already up-to-date: PyYAML>=3.10 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from mkdocs)
Requirement already up-to-date: tornado>=4.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from mkdocs)
Requirement already up-to-date: Jinja2>=2.7.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from mkdocs)
Requirement already up-to-date: click>=3.3 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from mkdocs)
Requirement already up-to-date: mkdocs-bootswatch>=0.1.0 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from mkdocs)
Requirement already up-to-date: mkdocs-bootstrap>=0.1.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from mkdocs)
Requirement already up-to-date: six in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from livereload>=2.3.2->mkdocs)
Requirement already up-to-date: backports.ssl-match-hostname in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from tornado>=4.1->mkdocs)
Requirement already up-to-date: singledispatch in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from tornado>=4.1->mkdocs)
Requirement already up-to-date: certifi in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from tornado>=4.1->mkdocs)
Requirement already up-to-date: backports-abc>=0.4 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from tornado>=4.1->mkdocs)
Requirement already up-to-date: MarkupSafe in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from Jinja2>=2.7.1->mkdocs)
$ cd /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
$ mkdocs
-bash: mkdocs: command not found
$ cd ~/
$ mkdocs --version
-bash: mkdocs: command not found
Are there additional steps needed to get mkdocs running on OSX?
I have encountered the same problem.
-bash: mkdocs: command not found
After setting the environment variable, it can be used.
sudo vim ~/.bash_profile
Append the following to the file and note that the path is replaced by yourself.
PATH="/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/:${PATH}"
export PATH
Make environment variables take effect.
source ~/.bash_profile
Then you can test it.
linupypc:~ linupy$ mkdocs
Usage: mkdocs [OPTIONS] COMMAND [ARGS]...
MkDocs - Project documentation with Markdown.
Options:
-V, --version Show the version and exit.
-q, --quiet Silence warnings
...
The rest, you should be able to operate. good luck.