How do in install chempy on Linux using miniconda? - python

Tried to install chempy on Linux as described in the documentation:
conda create -n chempy python=3.9
conda activate chempy
conda install -c bjodah chempy pytest
This resulted in the following error message.
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
- chempy -> python[version='2.7.*|3.5.*|3.6.*|3.4.*']
Switching to python version 3.6 didn't help either, as some packages explicitly demand 3.9 or higher.
System specification:
Operating system: Ubuntu 20.04.2 LTS
Miniconda version: 4.10.1
Python: 3.9

Unfortunately, the chempy conda package is not complete, nor is the pip package.
The only way it works seems to be to install dependencies manually from separate sources.
Install miniconda, create a separate environment and activate it:
conda create -n "chempy" python=3.9
conda activate chempy
Install dependencies
conda install -c anaconda boost
conda install -c conda-forge gsl
conda install -c conda-forge pycvodes
conda install -c conda-forge sundials
Now you can install chempy:
python3 -m pip install chempy[all]
Test your installation:
python3 -m pytest -rs -W \
ignore::chempy.ChemPyDeprecationWarning --pyargs \
chempy > test.out
The following tests will fail but chempy works nonetheless:
kinetics/tests/test__native.py FF..FFFFFF [ 3%]
...
util/tests/test_table.py ..FFF [100%]
System specification:
Operating systems: Ubuntu 20.04.2 LTS, Debian 10.9 (both 64-Bit-PC)
Miniconda version: 4.10.1
Python: 3.9
Note for Windows users:
Not all dependencies are available for Windows, so it's not possible to install chempy on Windows.
I recommend installing it in a virtual machine such as Virtual Box or wsl (not tested).

Related

Tensorflow < 2.4 chip M1

I am working on a project which requirements need python 3.7 and TensorFlow 2.3.1. The problem, I have a MacBook Pro with M1 chip. I was able to install and run TF 2.4.
However, I am running into more complicated compatibility issues.
Does anyone know how can I solve this?
M1 has a compatibility issue with TensorFlow. There is a workaround provided by Apple and other blogs. I have recently tried the same and have provided the summary below:
Tensorflow:
OS: BigSur(11.2.3)
Install command-line tools:
xcode-select --install
Install miniforge:
https://github.com/conda-forge/miniforge#miniforge3
After download run
chmod +x ~/<dir>/Miniforge3-MacOSX-arm64.sh
sh ~/<dir>/Miniforge3-MacOSX-arm64.sh
dir: directory to which miniforge is downloaded.
Or
brew install miniforge
After download change source to miniforge3
source ~/miniforge3/bin/activate
Download the environment.yml file from
https://github.com/mwidjaja1/DSOnMacARM
Setup a new conda environment using the yml file:
conda env create --file=environment.yml --name env_name
conda activate env_name
Install tensorflow dependencies:
conda install -c apple tensorflow-deps
Install base tensorflow:
python -m pip install tensorflow-macos
Install tensorflow-metal plugin:
python -m pip install tensorflow-metal
Possible Issues:
Miniforge uses conda-forge to install packages
Method to route channel to conda-forge
conda install -c conda-forge matplotlib
conda install or pip install might not work
Packages available for libraries in conda-forge:
https://anaconda.org/conda-forge
Only these will work.
Sources:
https://developer.apple.com/metal/tensorflow-plugin/
https://towardsdatascience.com/installing-tensorflow-on-the-m1-mac-410bb36b776
https://github.com/mwidjaja1/DSOnMacARM

AWS EC2 Python ModuleNotFoundError

I am using an EC2 instance with Deep Learning AMI based on Ubuntu 18.04.
I am doing the following:
Start the terminal
Activate the conda environment: conda activate tensorflow2_latest_p37
Install the package pip3 install tensorrt
Run my code python3 mycode.py
And I get the following error:
ModuleNotFoundError: No module named 'tensorrt'
I also trying to install as sudo or with -U or -m option. Nothing work. I can't install with conda install because tensorrt is not available in it.
pip3 will use ubuntu's level pip3, not from anaconda. You can confirm this by using which pip3 after you activate your environemnt. ALso tensorrt is not available for python other then 3.6
So to install tensorrt on Ubuntu 18.04 Deep Learnig:
conda activate tensorflow2_p36
# then in tensorflow2_p36 environment
pip install nvidia-pyindex
pip install --upgrade nvidia-tensorrt

Installing fbprophet Python on Windows 10

My build keeps failing on windows 10 for installing fbprophet in anaconda with the following message:
ERROR conda.core.link:_execute(502): An error occurred while installing package 'conda-forge::automat-0.7.0-py_1'.
CondaError: Cannot link a source that does not exist. C:\Users\bharat.c.ruparel\AppData\Local\Continuum\anaconda3\Scripts\conda.exe
the command that is given is:
conda install -c conda-forge fbprophet
Has anyone successfully installed fbprophet on Windows 10? If yes, then please give the steps.
Thanks.
I tried pip install as well but no luck. I have a Mac and managed to install fbprophet on it without any issues.
First install Anaconda or miniconda in your Windows machine and add conda python path to env variable as default python.
Open your command prompt and run following commands.
Create a conda virtual environment (optional)
conda create -n v-env python=3.7
activate v-env
Install c++ complier
conda install libpython m2w64-toolchain -c msys2
libpython will automatically create and setup distutils.cfg file for you in PYTHONPATH\Lib\distutils, but if that is failed use the following instructions to setup it manually
[OPTIONAL]
create distutils.cfg with text editor (e.g. notepad, notepad++) and add the following lines to that file.
[build]
compiler=mingw32
Install dependencies
conda install numpy cython -c conda-forge
conda install matplotlib scipy pandas -c conda-forge
Install PyStan
pip install pystan
or
conda install pystan -c conda-forge
Install Ephem
conda install -c anaconda ephem
Install fbprophet
pip install fbprophet
or
conda install -c conda-forge fbprophet
I also faced installing facebook prophet issue in windows 10 without conda.
But,we can solve it.
First, uninstall any pystan, fbprophet.
Then follow the steps below,
python.exe -m pip install pystan==2.17.1.0
python.exe -m pip install fbprophet==0.6
python.exe -m pip install --upgrade fbprophet
Thanks,
tsj
Updated: 28 July 2022
As of v1.0, the package name on PyPI is "prophet"; prior to v1.0 it was "fbprophet". fbprophet is now just prophet. A few additional considerations:
From v0.6 onwards, Python 2 is no longer supported.
As of v1.1, the minimum supported Python version is 3.7.
Below one will find how to
Install with PyPI
Install with Anaconda
Install the Development version
1. Istallation in Python using PyPI
Prophet is on PyPI, so one can use pip to install it.
python -m pip install prophet
2. Installation in Python using Anaconda
One might have to access Anaconda Prompt for the environment that one is working with as admin:
And run
conda-forge: conda install -c conda-forge prophet
Or
conda install -c conda-forge prophet -y
3. Development version
To get the latest code changes as they are merged, one can clone this repo and build from source manually. This is not guaranteed to be stable.
git clone https://github.com/facebook/prophet.git
cd prophet/python
python -m pip install -r requirements.txt
python setup.py develop
By default, Prophet will use a fixed version of cmdstan (downloading and installing it if necessary) to compile the model executables. If this is undesired and one would like to use one's existing cmdstan installation, one can set the environment variable PROPHET_REPACKAGE_CMDSTAN to False:
export PROPHET_REPACKAGE_CMDSTAN=False;
Sources
https://facebook.github.io/prophet/docs/installation.html
https://github.com/facebook/prophet
I've had the same problem. But it works after I follow this steps:
On Prompt install Ephem:
conda install -c anaconda ephem
Install Pystan:
conda install -c conda-forge pystan
Finally install Fbprophet
conda install -c conda-forge fbprophet
Latest installation code for 2021:
pip install pystan==2.19.1.1, then pip install prophet
Also, reboot your jupyter notebook after installation
Install without Conda, Win 10, Python 3.8.8 64 bit.
pip3 install Cython
Then install:
Reboot your maching
Install
pip3 install pystan==2.17.1.0
pip3 install fbprophet
Here's my solution. I have not use conda-forge before, so reading up on this article helps.
Making sure that conda is ≥4.9
conda --version
add conda forge channel
conda config --add channels conda-forge
conda --set channel_priority strict
install gcc
conda install gcc
install prophet
conda install -c conda-forge prophet
I used the prophet documentation here
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.
I am using Python 3.8.5 and conda 4.10.1 on a Windows 10 machine.
I was able to install prophet in Anaconda 2.0.1 using command prompt (not as admin), using: conda install -c conda-forge fbprophet
It took some time for it to figure out the details, as you can see from the prompts below, but finally it was able to install the package.
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done

How to run Spyder with Python 3.7 with Anaconda

I have installed Anaconda on a Windows 10 machine which comes with Spyder and Python 3.6 but I wish to upgrade to Python 3.7
To create an Anaconda Environment with Python 3.7 is easy by using:
conda create --name py37 python=3.7
or:
conda create --name py370 python=3.7.0 --channel conda-forge
However starting Spyder in this environment will throw it back to Python 3.6.
I tried specifing the python.exe (for version 3.7) directly in Tools -> Settings of Spyder, however upon restarting the Spyder Kernels can't be launched and will display that they need the packages: ipykernel and cloudpickle .
When trying to conda install them in the environment the following appears:
The following packages will be DOWNGRADED:
python: 3.7.0-hea74fb7_0 --> 3.6.6-hea74fb7_0
Which would downgreade python from 3.7 to 3.6 again.
My final try was to use the command:
conda install python==3.7
which has failed with the output
Solving environment: failed
UnsatisfiableError: The following specifications were found to be in conflict:
- python-dateutil -> python[version='>=2.7,<2.8.0a0']
- python-dateutil -> six
- python==3.7
Use "conda info <package>" to see the dependencies for each package.
The question is not how to upgrade Conda to Python 3.7, but how can I get Spyder to work with Python 3.7 in its own environment
When you run spyder from the CMD/terminal, your operating system tries to find the spyder executable on your system's PATH. In this case, it will default back to the base environment's version of spyder, which runs Python 3.6.
The best way I have found so far is to install spyder to the new environment; activate the environment, and then run spyder (which should fire up the version in the local environment).
conda create --name py37 python=3.7
conda install --name py37 spyder -c conda-forge
conda activate py37
spyder
However, this requires the version of spyder to support python 3.7. Currently that is not available (as of 2 July 2018), but it should not be too long coming.
EDIT:
Spyder for Python 3.7 is available.

Conflict while installing ggplot to conda python 3 environment

I tried to run
conda create --name test python=3
source activate test
conda install -c conda-forge ggplot=0.11.5
but after the last command I get
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ......
Solving package specifications: ....
The following specifications were found to be in conflict:
- ggplot 0.11.5* -> python 2.7*|3.4*|3.5*
- pip (target=pip-9.0.1-py36_1.tar.bz2) -> python 2.7*|3.4*|3.5*
- pip (target=pip-9.0.1-py36_1.tar.bz2) -> setuptools
- python 3.6*
- setuptools (target=setuptools-27.2.0-py36_0.tar.bz2) -> python 2.7*|3.4*|3.5*
- wheel (target=wheel-0.29.0-py36_0.tar.bz2) -> python 2.7*|3.3*|3.4*|3.5*|3.6*
- wheel (target=wheel-0.29.0-py36_0.tar.bz2) -> setuptools
Use "conda info <package>" to see the dependencies for each package.
I am able to run
conda install -c bokeh ggplot=0.9.4
instead, but that is an older version. I am not sure what would be a practical way of resolving this if I want to use the newer version of ggplot.
I could install the newer version in python 2.7 though.
Running 'conda create --name test python=3' will create a Python 3.6 environment by default.
If you take a look here: https://anaconda.org/conda-forge/ggplot/files you will see that the conda-forge version of ggplot is not compatible with Python 3.6. If you create an environment with Python 3.5 then you will be able to run this command again and successfully install your desired version of ggplot.
conda create --name test1 python=3.5
source activate test1
conda install -c conda-forge ggplot=0.11.5

Categories

Resources