cx_Freeze is installed using pip, but I am still getting an unresolved reference - cx-freeze

So according to my terminal, I am on python --version 3.9.9. I have been trying to turn a large python GUI project into a .exe file by using cx_Freeze. I installed it using the command:
pip install cx_Freeze
This results in what I believe to be a successful installation because I am getting the following result:
Collecting cx-Freeze
Using cached cx_Freeze-6.11.1-cp39-cp39-macosx_10_9_x86_64.whl (14.7 MB)
Requirement already satisfied: packaging>=21.0 in /opt/anaconda3/lib/python3.9/site-packages (from cx-Freeze) (21.3)
Requirement already satisfied: importlib-metadata>=4.8.3 in /opt/anaconda3/lib/python3.9/site-packages (from cx-Freeze) (4.11.3)
Requirement already satisfied: setuptools<=60.10.0,>=59.0.1 in /opt/anaconda3/lib/python3.9/site-packages (from cx-Freeze) (60.10.0)
Requirement already satisfied: zipp>=0.5 in /opt/anaconda3/lib/python3.9/site-packages (from importlib-metadata>=4.8.3->cx-Freeze) (3.7.0)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /opt/anaconda3/lib/python3.9/site-packages (from packaging>=21.0->cx-Freeze) (3.0.4)
Installing collected packages: cx-Freeze
Successfully installed cx-Freeze-6.11.1
The problem I am having is that in my setup.py file, I have an undefined reference error under cx_Freeze, setup, and Executable in the following line:
from cx_Freeze import setup, Executable
I have tried installing cx_Freeze through the GUI on pyCharm but it fails. Here is my interpreter information on pyCharm:
Python 3.9 located at /opt/anaconda3/envs/LADS/bin/python
Any insight would be much appreciated. Thanks.

Related

Hide "Requirement already satisfied" warning from pip in Kaggle kernel

I want to install dataprep package in Kaggle Kernel.
As simple:
!pip install dataprep
is working but display many line Requirement already satisfied
Requirement already satisfied: dataprep in /opt/conda/lib/python3.7/site-packages (0.4.0)
Requirement already satisfied: numpy<2,>=1 in /opt/conda/lib/python3.7/site-packages (from dataprep) (1.19.5)
Requirement already satisfied: levenshtein<0.13.0,>=0.12.0 in /opt/conda/lib/python3.7/site-packages (from dataprep) (0.12.0)
Requirement already satisfied: varname<0.9.0,>=0.8.1 in /opt/conda/lib/python3.7/site-packages (from dataprep) (0.8.1)
......
From recommendation in stackoverflow I try with:
!pip install -q dataprep
But I got the error:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
beatrix-jupyterlab 3.1.1 requires google-cloud-bigquery-storage, which is not installed.
preprocessing 0.1.13 requires nltk==3.2.4, but you have nltk 3.6.3 which is incompatible.
flask 2.0.2 requires Jinja2>=3.0, but you have jinja2 2.11.3 which is incompatible.
featuretools 1.0.0 requires dask[dataframe]>=2021.2.0, but you have dask 2.30.0 which is incompatible.
distributed 2021.10.0 requires dask==2021.10.0, but you have dask 2.30.0 which is incompatible.
How does my kernel not display Requirement already satisfied in the first way?
Looks like a solution exists at
Hide "Requirement already satisfied" warning
pip install -r requirements.txt | grep -v 'already satisfied'

Pip does ONLY install old and wrong version of my own package

I am working on a package https://pypi.org/project/sgraphic/ it is at version 0.1.1 but pip does not care. It only installs version 0.0.3
I've tried many solutions suggested here without luck. Ugprading pip, installing packages with no_cache but nothing works.
Any ideas what to try?
Here is a dump of me trying to upgrade
pip install sgraphic --upgrade
Requirement already satisfied: sgraphic in /home/user/anaconda3/lib/python3.7/site-packages (0.0.3)
Collecting sgraphic
Downloading sgraphic-0.1.1.tar.gz (4.4 kB)
Requirement already satisfied: skia-python in /home/user/anaconda3/lib/python3.7/site-packages (from sgraphic) (87.1)
Requirement already satisfied: IPython in /home/user/anaconda3/lib/python3.7/site-packages (from sgraphic) (7.22.0)
Using cached sgraphic-0.1.0.tar.gz (4.4 kB)
Using cached sgraphic-0.0.5-py3-none-any.whl (5.8 kB)
Requirement already satisfied: easing-functions in /home/user/anaconda3/lib/python3.7/site-packages (from sgraphic) (1.0.3)
Requirement already satisfied: numpy in /home/user/anaconda3/lib/python3.7/site-packages (from sgraphic) (1.20.3)
Using cached sgraphic-0.0.4-py3-none-any.whl (5.8 kB)
when running pip show sgraphic i get
Name: sgraphic
Version: 0.0.3
It seems to me that the current version (0.1.1) requires PIL, which cannot be installed using pip:
pip install sgraphic==0.1.1
Collecting sgraphic==0.1.1
Using cached sgraphic-0.1.1.tar.gz (4.4 kB)
Collecting skia-python
Using cached skia_python-87.2-cp39-cp39-win_amd64.whl (4.3 MB)
Collecting IPython
Using cached ipython-7.27.0-py3-none-any.whl (787 kB)
ERROR: Could not find a version that satisfies the requirement PIL (from sgraphic) (from versions: none)
ERROR: No matching distribution found for PIL
Because pip cannot install all dependencies, it fails to install sgraphic 0.1.1. However, if you do not explicitly request this version, pip will try to find an older version that it can install. Apparently, version 0.0.3 is the latest version it can install, so in your case it did that.
I think this is simply a bug in the latest versions of the sgraphic package. The code contains import PIL, but the package that contains PIL is actually called Pillow. It's also possible that (the original) PIL is supposed to be installed in another way, but I could not find any information about that.
NB: I created an issue on github to ask the author of the package. It was indeed a bug and is now fixed in version 0.1.2, which I could install successfully using pip.

Cant install PyTorch using pip on Windows

Hi after pasting this command to console: pip install torch==1.7.1+cpu torchvision==0.8.2+cpu torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html (as shown on PyTorch website) I get this error:
C:\Users\m.povilaika>pip install torch==1.7.1+cpu torchvision==0.8.2+cpu torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
Looking in links: https://download.pytorch.org/whl/torch_stable.html
Collecting torch==1.7.1+cpu
Using cached https://download.pytorch.org/whl/cpu/torch-1.7.1%2Bcpu-cp39-cp39-win_amd64.whl (184.2 MB)
Collecting torchvision==0.8.2+cpu
Using cached https://download.pytorch.org/whl/cpu/torchvision-0.8.2%2Bcpu-cp39-cp39-win_amd64.whl (804 kB)
Collecting torchaudio===0.7.2
Using cached https://download.pytorch.org/whl/torchaudio-0.7.2-cp39-none-win_amd64.whl (103 kB)
Requirement already satisfied: numpy in c:\users\m.povilaika\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from torch==1.7.1+cpu) (1.19.4)
Requirement already satisfied: typing-extensions in c:\users\m.povilaika\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from torch==1.7.1+cpu) (3.7.4.3)
Requirement already satisfied: pillow>=4.1.1 in c:\users\m.povilaika\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from torchvision==0.8.2+cpu) (8.1.0)
Installing collected packages: torch, torchvision, torchaudio
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'C:\\Users\\m.povilaika\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python39\\site-packages\\caffe2\\python\\serialized_test\\data\\operator_test\\collect_and_distribute_fpn_rpn_proposals_op_test.test_collect_and_dist.zip'
Please help, I don't usually use windows, not sure what to do about the path error.
Thanks in advance.

Cannot start qutebrowser, installed packages are shown as missing

I'm trying to install qutebrowser with tox and followed the instructions on this page.
However, this didn't work. When I run
python3 -m qutebrowser
I get one of the error messages
Fatal error: jinja2 is required to run qutebrowser but could not be imported! Maybe it's not installed?
The error encountered was:
No module named 'jinja2'
Please search for the python3 version of jinja2 in your distributions packages, or see https://github.com/qutebrowser/qutebrowser/blob/master/doc/install.asciidoc
If you installed a qutebrowser package for your distribution, please report this as a bug.
or the same with PyYAML/yaml instead of jinja2.
However, if I run
sudo pip install jinja2
sudo pip install pyyaml
I get
Requirement already satisfied: jinja2 in /usr/local/lib/python2.7/dist-packages (2.10.1)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/lib/python2.7/dist-packages (from jinja2) (0.23)
Requirement already satisfied: pyyaml in /usr/local/lib/python2.7/dist-packages (5.1)
I guess the problem may be that the installed versions are for python2.7, however I followed these instructions without change.
You followed those instructions with a change: you run python3 instead of python.
If you have both Python 2.7 and Python 3 installed to install packages for Python 3 you need to run pip3 install or python3 -m pip install.

-bash: pylint: command not found

I have been trying to install pylint to be used on terminal, but have been unsuccessful in using it. The installation gets successful, but whenever I try to run pylint command, it returns the following error -
-bash: pylint: command not found
I have tried using following commands -
pip install pylint
python -m pip install pylint
sudo pip install pylint
sudo -H pip install pylint
I have uninstalled it, before trying each of the above command, but everytime I install it, the installation gets successful, but I am unable to use it on command line. I know it's something silly I am missing.
Here's the output I get on installation -
My-Mac:Dev noob$ sudo -H pip install pylint
Collecting pylint
Using cached pylint-1.6.5-py2.py3-none-any.whl
Requirement already satisfied: isort>=4.2.5 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from pylint)
Requirement already satisfied: six in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from pylint)
Requirement already satisfied: mccabe in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from pylint)
Requirement already satisfied: configparser; python_version == "2.7" in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from pylint)
Requirement already satisfied: backports.functools-lru-cache; python_version == "2.7" in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from pylint)
Requirement already satisfied: astroid<1.5.0,>=1.4.5 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from pylint)
Requirement already satisfied: wrapt in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from astroid<1.5.0,>=1.4.5->pylint)
Requirement already satisfied: lazy-object-proxy in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from astroid<1.5.0,>=1.4.5->pylint)
Installing collected packages: pylint
Successfully installed pylint-1.6.5
PS: I am using macOS Sierra 10.12.3 on a Macbook pro Late 2011, in case this is relevant.
The issue is installed python executables aren't being added to your path. Our paths don't look exactly the same (probably because different python versions, I'm not sure) but mine is
host:~ williamhammond$ pip install pylint
Requirement already satisfied: pylint in /Users/williamhammond/Library/Python/3.7/lib/python/site-packages (2.3.1)
Requirement already satisfied: astroid<3,>=2.2.0 in /Users/williamhammond/Library/Python/3.7/lib/python/site-packages (from pylint) (2.2.5)
Requirement already satisfied: isort<5,>=4.2.5 in /Users/williamhammond/Library/Python/3.7/lib/python/site-packages (from pylint) (4.3.21)
Requirement already satisfied: mccabe<0.7,>=0.6 in /Users/williamhammond/Library/Python/3.7/lib/python/site-packages (from pylint) (0.6.1)
Requirement already satisfied: wrapt in /Users/williamhammond/Library/Python/3.7/lib/python/site-packages (from astroid<3,>=2.2.0->pylint) (1.11.2)
Requirement already satisfied: six in /Users/williamhammond/Library/Python/3.7/lib/python/site-packages (from astroid<3,>=2.2.0->pylint) (1.12.0)
Requirement already satisfied: typed-ast>=1.3.0; implementation_name == "cpython" in /Users/williamhammond/Library/Python/3.7/lib/python/site-packages (from astroid<3,>=2.2.0->pylint) (1.4.0)
Requirement already satisfied: lazy-object-proxy in /Users/williamhammond/Library/Python/3.7/lib/python/site-packages (from astroid<3,>=2.2.0->pylint) (1.4.1)
I was seeing the same issues as you until I looked here
host:~ williamhammond$ ls /Users/williamhammond/Library/Python/3.7/bin/
dmypy epylint isort mypy pep8 pylint pyreverse stubgen symilar
Once you add this to your path like
export PATH=$PATH:/Users/williamhammond/Library/Python/3.7/bin/
you should be able to use pylint. To make this change permanent make sure to add the command to your ~/.bashrc
For the very last comment in the response given by William Hammond on making this change permanent make sure to add the command to your ~/.bashrc, you'd find the hyperlink above a useful guide to get this done:

Resources