Installing pygame for python3 in mac using anaconda - python-3.x

I am trying to install pygame for python 3 and get the error:
conda install -c cogsci pygame
Solving environment: failed
UnsatisfiableError: The following specifications were found to be in
conflict:
- pygame
- xlwt
Use "conda info <package>" to see the dependencies for each package.
Tried to install xlwt again but nothing change :
conda install xlwt
Solving environment:
done
All requested packages already installed.
Any idea how to install it?
Thanks

The UnsatisfiableError means that the two packages listed cannot be installed in the same environment. You need to create a new environment to install pygame:
conda create -n pygameenv -c cogsci pygame

Related

How to install packages on a conda environment with a specific python version

I need to use opencv and it needed python version older than 3.9. So I created a conda environment with python 3.7.9 and tried to use
pip install opencv-python
It installed but when I tried to import it gave an error:
ModuleNotFoundError: No module named 'cv2'
After I installed it on the anaconda environments tab I could import. I need to install pylibdmtx, too, but again I cannot import it after installing.
I see the version of python is 3.7.9 on the environment. But when I use pip it is using this:
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (0.1.9)
I do not know what I am missing here. What should I do?
Recommended Solution
Prefer specifying what you want in an environment up front, e.g.,
opencv.yaml
name: py37_opencv
channels:
- conda-forge
- defaults
dependencies:
- python=3.7
- opencv
Create Environment
conda env create -n py37_opencv -f opencv.yaml
Troubleshooting Issue
Otherwise, if you want get the version you have working, try ensuring that pip is actually installed in the environment of interest:
conda activate your_env
conda install pip
# then use pip …

Could not build wheels for fbprophet which do not use PEP 517

I am trying to install Facebook's Prophet package on my windows system using pip install fbprophet command. However, I am getting an error:
DEPRECATION: Could not build wheels for fbprophet which do not use PEP 517.
I am using pip version 20.2.2, Python 3.6.8 and all other requirements are satisfied.
I tried searching the issue with PEP 517, but couldn't find one. It seems that fbprophet package do not use PIP 517. I couldn't find a way to disable it or an alternative to install the package.
I also tried using conda install -c conda-forge fbprophet, but no luck.
Please let me know what is the issue and how can I resolve it.
Thanking you in anticipation.
You've probably resolved this by now or moved on but I was having a similar issue. On Windows I was able to install prophet by first running:
conda install -c conda-forge compilers
to install the appropriate compilers. Then run:
conda install -c conda-forge prophet
On MacOS I found I needed to install ruby version manager (RVM) to be able to install prophet

How to install opencv in anaconda on windows

I want to install opencv in anaconda on windows and I tried bunch of ways but I could not install it my last attempt is :
conda install -c https://conda.binstar.org/menpo opencv
and i get :
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... failed
Note: you may need to restart the kernel to use updated packages.
and after that :
WARNING conda.base.context:use_only_tar_bz2(632): Conda is constrained to only using the old .tar.bz2 file format because you have conda-build installed, and it is <3.18.3. Update or remove conda-build to get smaller downloads and faster extractions.
UnsatisfiableError: The following specifications were found to be incompatible with each other:
anaconda==2019.03=py37_0 -> h5py==2.9.0=py37h5e291fa_0 -> hdf5[version='>=1.10.4,<1.10.5.0a0']
anaconda==2019.03=py37_0 -> importlib_metadata==0.8=py37_0 -> zipp[version='>=0.3.2']
h5py -> hdf5[version='>=1.10.4,<1.10.5.0a0']
hdf5
pkgs/main/win-64::importlib_metadata==0.8=py37_0 -> zipp[version='>=0.3.2']
pkgs/main/win-64::path.py==11.5.0=py37_0 -> importlib_metadata[version='>=0.5']
pkgs/main/win-64::zipp==0.3.3=py37_1
pytables -> hdf5[version='>=1.10.4,<1.10.5.0a0']
We had the same issue described in the other answer with 3.7, however the command that worked is conda create --name py3 python=3.6 following by activate py3 and it should work for you.
We also faced similar issue when installed Anaconda with python 3.7 .
the following steps solved our problem .
Created a new virtual environment with python 3.6
conda create -n new_env python=3.6
activate that environment
conda activate new_env
and then install opencv 3
conda install -c menpo opencv=3
I think it is better to follow these steps :
Open Anaconda Prompt and type following command :
conda create -n tensorflow_cpu pip python=3.6
After creating a new environment try this command line :
activate tensorflow_cpu
Then you can start installing the Tensorflow library by this command :
pip install --ignore-installed --upgrade tensorflow==1.9
After finishing installation close the prompt and reopen it .
Type python in prompt and trying command import tensorflow as tf
if you're directing to prompt without Error "well done "
what worked for me is :
pip install opencv-contrib-python

Problem when installing pybox2d with anaconda

I tried to install pybox2d through anaconda navigator with Python 3.7 , but it shows this error, I could not solve
I read all the library documentation!
Error:
(user) user#euser:~$ conda install -c https://conda.anaconda.org/kne pybox2d
Solving environment: failed
UnsatisfiableError: The following specifications were found to be in conflict:
- jeepney
- notebook==5.7.4
- pybox2d
Use "conda info " to see the dependencies for each package.
I had the same problem. My tensorflow and pybox2d where conflicting.
I followed these steps by anuj:
conda create -n stackoverflow_env python=3.7
source activate stackoverflow_env
conda install -c kne pybox2d
and then installed tensorflow from anaconda navigator in this environment.
I created a new conda environment to avoid being influenced by the existing installations and followed the steps given below. After this, Box2D is importing fine for me.
conda create -n stackoverflow_env python=3.7
source activate stackoverflow_env
conda install -c kne pybox2d

Can someone help me in installing python package "Prophet" on windows 10

Can someone help me in installing python package "Prophet" on windows 10 .
I tried installing python 3.5 and the dependency 'pystan' but yet I get below error.
"The package setup script has attempted to modify files on your system that are not within the EasyInstall build area, and has been aborted.This package cannot be safely installed by EasyInstall, and may not support alternate installation locations even if you run its setup script by hand.Please inform the package's author and the EasyInstall maintainers to find out if a fix or workaround is available.
Command "python setup.py egg_info" failed with error code 1 in c:\users\suman\appdata\local\temp\pip-build-aqoiqs\fbprophet\"`
I spent a good two days on this issue, finally, I found the following solution
1) Download and install Anaconda 3 (for python 3.6)
2) Create an environment and call it whatever you like
3) Run that environment (which will open the command prompt)
4) follow the following steps in command prompt : (commands are shown in bold)
python -m pip install -U pip
Requirement already up-to-date: pip in c:\users\william\anaconda3\envs\testtime\lib\site-packages
conda install -c conda-forge pystan
Fetching package metadata ...............
Solving package specifications: .
Package plan for installation in environment C:\Users\William\Anaconda3\envs\Testtime:
The following NEW packages will be INSTALLED:
backports: 1.0-py36_1 conda-forge
backports.functools_lru_cache: 1.4-py36_1 conda-forge
ca-certificates: 2017.11.5-0 conda-forge
cycler: 0.10.0-py36_0 conda-forge
cython: 0.27.3-py36_0 conda-forge
freetype: 2.7-vc14_1 conda-forge [vc14]
icc_rt: 2017.0.4-h97af966_0
icu: 58.2-vc14_0 conda-forge [vc14]
intel-openmp: 2018.0.0-hd92c6cd_8
jpeg: 9b-vc14_2 conda-forge [vc14]
libpng: 1.6.34-vc14_0 conda-forge [vc14]
matplotlib: 2.1.0-py36_0 conda-forge
mkl: 2018.0.1-h2108138_4
numpy: 1.13.3-py36ha320f96_0
openssl: 1.0.2m-vc14_0 conda-forge [vc14]
pyparsing: 2.2.0-py36_0 conda-forge
pyqt: 5.6.0-py36_4 conda-forge
pystan: 2.17.0.0-py36_vc14_0 conda-forge [vc14]
python-dateutil: 2.6.1-py36_0 conda-forge
pytz: 2017.3-py_2 conda-forge
qt: 5.6.2-vc14_1 conda-forge [vc14]
sip: 4.18-py36_1 conda-forge
six: 1.11.0-py36_1 conda-forge
tornado: 4.5.2-py36_0 conda-forge
zlib: 1.2.11-vc14_0 conda-forge [vc14]
pip install fbprophet
I also had several issues installing prophet on my Windows 10 machine using conda and Python 3.7.
The following steps made it work:
Create a fresh conda environment
Install pystan and other dependencies using conda install numpy cython matplotlib scipy pandas -c conda-forge (see https://pystan2.readthedocs.io/en/latest/windows.html#steps)
Install prophet using conda install prophet -c conda-forge
In then still had a numpy error Importing the numpy c-extensions failed... as described here: https://numpy.org/devdocs/user/troubleshooting-importerror.html But this was due to my IDE which is VS Code as I could successfully run my prohet model using the command line with the activated conda environment.
So please also make sure to test the installation from the command line in order to rule out that the error stems from you IDE.
Not sure if the same trick would work on Windows, anyways posting w.r.t what just worked on RHEL 7, f.w.i.w
Motivation was installing fbprophet using conda:
conda install -c conda-forge fbprophet
and, it could install pystan==2.17.1.0 and fbprophet==0.6
So, the trick was:
uninstall the pystan package when you had earlier run pip3 install fbprophet, basically one needs to execute the following:
pip3 install pystan==2.17.1.0
pip3 install fbprophet==0.6
And one can thereby import fbprophet in python3 terminal, so working :)
I currently have a fairly vanilla install of Python 3.5 on my Windows 10 machine that I setup using Anaconda.
I was able to install Prophet using the below command, that might work for you. Depending on how your installed Python you may need to run the below command in a cmd shell that was opened as administrator.
pip install prophet
Whenever I have tried to install fbprophet package multiple issues have come.I will suggest a few steps, hopefully they should work.
Close all existing Python / R running instances. If possible restart the machine. I have seen to work as few libraries / dependencies which I want to update might be getting used by existing running instances.
Use anaconda prompt.
First install pystan -
`conda install pystan`
Now install fbprophet
'conda install -c conda-forge fbprophet
Hopefully it should work for you. Also, ensure you have admin rights.
I faced the same issue and my solution was to:-
Create a new environment with Python3.5
conda create -n pht python=3.5 anaconda
Install Prophet using the command.
conda install -c conda-forge fbprophet
I didn't install 'gcc' although this was advised before installing Prophet.

Resources