PyQt-Fit installation failed - python

Installation failed on Windows 10 machine for Python 3.8.3
pip install PyQt-Fit
ERROR: Command errored out with exit status 1:
command: 'c:\users\mkz\appdata\local\programs\python\python38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\mkz\AppData\Local\Temp\pip-install-rn6exgn0\distribute\setup.py'"'"'; file='"'"'C:\Users\mkz\AppData\Local\Temp\pip-install-rn6exgn0\distribute\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\mkz\AppData\Local\Temp\pip-pip-egg-info-6yfk5kue'
cwd: C:\Users\mkz\AppData\Local\Temp\pip-install-rn6exgn0\distribute
Complete output (15 lines):
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\mkz\AppData\Local\Temp\pip-install-rn6exgn0\distribute\setuptools_init_.py", line 2, in
from setuptools.extension import Extension, Library
File "C:\Users\mkz\AppData\Local\Temp\pip-install-rn6exgn0\distribute\setuptools\extension.py", line 5, in
from setuptools.dist import get_unpatched
File "C:\Users\mkz\AppData\Local\Temp\pip-install-rn6exgn0\distribute\setuptools\dist.py", line 7, in
from setuptools.command.install import install
File "C:\Users\mkz\AppData\Local\Temp\pip-install-rn6exgn0\distribute\setuptools\command_init.py", line 8, in
from setuptools.command import install_scripts
File "C:\Users\mkz\AppData\Local\Temp\pip-install-rn6exgn0\distribute\setuptools\command\install_scripts.py", line 3, in
from pkg_resources import Distribution, PathMetadata, ensure_directory
File "C:\Users\mkz\AppData\Local\Temp\pip-install-rn6exgn0\distribute\pkg_resources.py", line 1518, in
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

After spending a few hours, I realized that maybe PyQt-Fit only works with python 2.7 then I created a conda environment with python 2.7 and created a kernel
//This is for conda to support switching kernels
conda install nb_conda
conda create -n py27 python=2.7
conda activate py27
//install PyQt-Fit
pip install -I path.py==7.7.1
pip install git+https://github.com/Multiplicom/pyqt-fit.git
// This is needed for Jupyter Notebook connecting with new kernel
pip install pypiwin32
//Make sure you are at the same directory as the py27 env, for example, C:\Anaconda3\envs\py27
//Create a new kernel
conda install notebook ipykernel
ipython kernelspec install-self
//now run jupyter notebook
A few useful links that helped me to get things fixed.
https://docs.continuum.io/anaconda/user-guide/tasks/use-jupyter-notebook-extensions/
https://github.com/ipython/ipykernel/issues/52
In which conda environment is Jupyter executing?
PyQt_Fit: cannot import name path

Related

Error: Command errored out with exit status 1: (really long command)

$ cd surface_dynamics
$ pip3 install .
Processing /Users/jacobelection/surface_dynamics
ERROR: Command errored out with exit status 1:
command: /usr/local/Caskroom/miniconda/base/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/m8/lmzlkfq11wj3rn17q7xm7g2m0000gn/T/pip-req-build-ubkp2yci/setup.py'"'"'; __file__='"'"'/private/var/folders/m8/lmzlkfq11wj3rn17q7xm7g2m0000gn/T/pip-req-build-ubkp2yci/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/m8/lmzlkfq11wj3rn17q7xm7g2m0000gn/T/pip-pip-egg-info-jhapggrl
cwd: /private/var/folders/m8/lmzlkfq11wj3rn17q7xm7g2m0000gn/T/pip-req-build-ubkp2yci/
Complete output (15 lines):
Traceback (most recent call last):
File "/private/var/folders/m8/lmzlkfq11wj3rn17q7xm7g2m0000gn/T/pip-req-build-ubkp2yci/setup.py", line 9, in <module>
import sage.all
ModuleNotFoundError: No module named 'sage'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/m8/lmzlkfq11wj3rn17q7xm7g2m0000gn/T/pip-req-build-ubkp2yci/setup.py", line 11, in <module>
raise ValueError("this package currently installs only inside SageMath (http://www.sagemath.org)\n"
ValueError: this package currently installs only inside SageMath (http://www.sagemath.org)
If you are using Ubuntu with Sage installed from the official apt repository, run
first in a console "$ source /usr/share/sagemath/bin/sage-env"
----------------------------------------
WARNING: Discarding file:///Users/jacobelection/surface_dynamics. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
How could I fixed these problem? My python version is 3.8.3. macOS Big Sur 11.1
The command needs to be run with the pip that
corresponds to SageMath's Python, which would
depend on the way SageMath was installed:
built from source?
from binaries from the SageMath download page?
from Marc Culler's SageMath app?
via Homebrew cask?
via Conda?
One way to go is to install the SageMath macOS app from
https://github.com/3-manifolds/Sage_macOS/releases
and run the Recommended.pkg installer.
Then instead of
pip3 install .
run
sage --pip install .
Or if you installed SageMath via Conda, make sure to
first activate the corresponding Conda environment:
conda activate sage
pip install .
In case of doubt, check what pip is going to be called
with commands such as:
which pip
ls -halF $(which pip)
which pip3
ls -halF $(which pip3)

Error trying to install a library in Python [duplicate]

This question already has answers here:
Unable to install pygame on Python via pip (Windows 10)
(6 answers)
Closed 2 years ago.
I'm trying to install the pygame library of python, to do it I use pip install pygame in the CMD of Windows, but then I get this error.
Collecting pygame
Using cached pygame-1.9.6.tar.gz (3.2 MB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\marcg\appdata\local\programs\python\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\marcg\\AppData\\Local\\Temp\\pip-install-c1fzrnpr\\pygame\\setup.py'"'"'; __file__='"'"'C:\\Users\\marcg\\AppData\\Local\\Temp\\pip-install-c1fzrnpr\\pygame\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\marcg\AppData\Local\Temp\pip-pip-egg-info-07h2j4on'
cwd: C:\Users\marcg\AppData\Local\Temp\pip-install-c1fzrnpr\pygame\
Complete output (17 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x64"? [Y/n]Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\marcg\AppData\Local\Temp\pip-install-c1fzrnpr\pygame\setup.py", line 194, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\marcg\AppData\Local\Temp\pip-install-c1fzrnpr\pygame\buildconfig\config.py", line 210, in main
deps = CFG.main(**kwds)
File "C:\Users\marcg\AppData\Local\Temp\pip-install-c1fzrnpr\pygame\buildconfig\config_win.py", line 576, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\marcg\AppData\Local\Temp\pip-install-c1fzrnpr\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
reply = raw_input(
EOFError: EOF when reading a line
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Can anyone help me?
You could try to install wheel before pip install wheel before installing pygame so it use already compiled package instead of trying to build it.
Python 3.8 doesn't support latest 1.9.6 pygame...
Try :
python3 -m pip install pygame==2.0.0.dev6
UPDATE: Windows users please use python instead of python3 and pip instead of pip3
Try pip3 uninstall pygame
and then python3 -m pip install -U pygame==2.0.0 --user
To see if it works, run one of the included examples:
python3 -m pygame.examples.aliens
If you get 'PermissionError: [WinError 5] Access is denied', before starting the command prompt right click and "Run as administrator".
If pip3 is not there, use pip
Make sure pip is updated.
Watch this video
https://www.youtube.com/watch?v=ABe_qpzQu0Q to learn about updating pip
Make sure to Read pygame official docs about windows installation

No such file or directory error when installing github package in anaconda

I am trying to install this module from github.
https://github.com/ChristianSchneeweiss/Chat-txt-to-csv
First, I am following the steps listed here.
https://medium.com/i-want-to-be-the-very-best/installing-packages-from-github-with-conda-commands-ebf10de396f4
so I used this line in Anaconda Powershell Prompt
pip install git+git://github.com/ChristianSchneeweiss/Chat-txt-to-csv.git
it didn't work. and then I used this code, based on the suggestions here.
Use package from Github in Conda Virtual Environment
pip install C:\Users\Lulz\Documents\mamanitip\chat_wa\Chat-txt-to-csv-master.zip
it didn't work either. both codes resulted in this error.
command: 'C:\ProgramData\Anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Lulz\\AppData\\Local\\Temp\\pip-req-build-2cr6dd41\\setup.py'"'"'; __file__='"'"'C:\\Users\\Lulz\\AppData\\Local\\Temp\\pip-req-build-2cr6dd41\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Lulz\AppData\Local\Temp\pip-pip-egg-info-3o0zsjkm'
cwd: C:\Users\Lulz\AppData\Local\Temp\pip-req-build-2cr6dd41\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\ProgramData\Anaconda3\lib\tokenize.py", line 447, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Lulz\\AppData\\Local\\Temp\\pip-req-build-2cr6dd41\\setup.py'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
i've tried creating new Microsoft accounts, and installing in a new environment, but it still didn't work. it always resulted in the same error, just different users (as I change Microsoft accounts). what did I do wrong? thank you so much for your help.
The package at https://github.com/ChristianSchneeweiss/Chat-txt-to-csv cannot be installed with pip because it does not have the file setup.py. What you can do instead is to download the project onto your computer, install the project's dependencies, and then use the project from its directory. If you run python from within that project's directory, it will find the package.
git clone https://github.com/ChristianSchneeweiss/Chat-txt-to-csv
cd Chat-txt-to-csv
python -m pip install --no-cache-dir -r requirements.txt
python convert.py chat.txt

problems when using pip install

I am not quite experienced using pip. When I tried to install some packages, I had this error and had no idea what that meant. This happened to multiple packages that I tried to install. Any suggestions would be appreciated.
sudo pip install mysql-python
Password:
WARNING: The directory '/Users/yzr/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting mysql-python
Downloading MySQL-python-1.2.5.zip (108 kB)
|████████████████████████████████| 108 kB 2.2 MB/s
ERROR: Command errored out with exit status 1:
command: /Users/yzr/opt/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-0kcqh5vw/mysql-python/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-0kcqh5vw/mysql-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/tmp/pip-install-0kcqh5vw/mysql-python/pip-egg-info
cwd: /private/tmp/pip-install-0kcqh5vw/mysql-python/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-install-0kcqh5vw/mysql-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/private/tmp/pip-install-0kcqh5vw/mysql-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I’m assuming you are using an Unix system such as Linux or MacOS.
Maybe you are accidentally using the python2.7 version installed on your system.
You can use a specific version of python for pip with:
python3 -m pip install mysql-python
Let me explain myself, every MacOS or Linux system has two Python versions (2.7 and 3.x) by default, and both of those versions has a pip module related to it, in other words, you have a pip module for Python 2.7 and other pip module for Python 3.x.
However, I’m assuming you are using python3 for your project, therefore, you must specify the pip module to use.
Other way to avoid this problem is using a virtual environment manager, such as pipenv or built in virtualenv module.
It looks like your pip package doesn't have the module "ConfigParser" installed. You should be able to install it by running:
pip install ConfigParser
Alternatively, depending on your Python version, try installing mysqlclient instead:
pip install mysqlclient

Error when trying to install pygame on Python 3

I tried installing pygame using
pip install pygame
I tried installing it using Python 3.8 but it outputs the error below.
I also tried installing using Python 3.7 but still no luck.
The error:
ERROR: Command errored out with exit status 1:
command: 'c:\users\asus\appdata\local\programs\python\python38-32\python.exe'
-c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Asus\\AppData\\Local\\Temp\\pip-install-_ptqagog\\pygame\\setup.py'"'"';
__file__='"'"'C:\\Users\\Asus\\AppData\\Local\\Temp\\pip-install-_ptqagog\\pygame\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\pip-egg-info'
cwd: C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\
Complete output (17 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x86"? [Y/n]Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\setup.py", line 194, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\buildconfig\config.py", line 210, in main
deps = CFG.main(**kwds)
File "C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\buildconfig\config_win.py", line 576, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\Asus\AppData\Local\Temp\pip-install-_ptqagog\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
reply = raw_input(
EOFError: EOF when reading a line
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Use this (I was facing the same issue and it helped me out):
pip install pygame --pre
You can try to install from the Wheel file.
After verifying that you're using python 3.7
python --version # Python 3.7.X
pip install pygame-1.9.6-cp37-cp37m-win_amd64.whl
What kind of OS system are you using? I have no problem to install on python 3.7
(base) $ python3 -m pip install -U pygame --user
Collecting pygame
Downloading https://files.pythonhosted.org/packages/32/37/453bbb62f90feff2a2b75fc739b674319f5f6a8789d5d21c6d2d7d42face/pygame-1.9.6-cp37-cp37m-macosx_10_11_intel.whl (4.9MB)
|████████████████████████████████| 4.9MB 2.7MB/s
Installing collected packages: pygame
Successfully installed pygame-1.9.6
(base) $ python -m pygame.examples.aliens
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
If the problem persists, you should use conda or another environment manager to create new environment and then install the library.
I'm not getting an error when I do this. Have you tried:
pip install pygame
Have you attempted installing with command-prompt or terminal? When I run what you are doing, I don't seem to get a problem.
Additionally, pygame is not compatible with 3.8 yet as it is unstable. Maybe wait a few months until modules are ready to be used with 3.8. Hope this helps, good day.

Categories