Install cx_freeze on anaconda? - python

I'm trying to install cx_freeze to a virtual environment I've made in anaconda. From within the environment, I type (https://binstar.org/pyzo/cx_freeze):
conda install -c https://conda.binstar.org/pyzo cx_freeze
I get the following message:
Fetching package metadata: ...
Solving package specifications: ..
Error: Unsatisfiable package specifications.
Generating hint:
[2/2 ] |#####################################################################################################################################################################################| 100%
Hint: the following combinations of packages create a conflict with the
remaining packages:
- python 2.7*
- cx_freeze
I'm using anaconda 3.7.4 on python version 2.7.9 on linux-64 Ubuntu 14.

In case conda install cannot install a package because there is a conflict with the version of Python you use:
make sure pip is installed in your current (virtual) Python environment: conda install pip (or conda list to see whether pip is in the list of installed packages)
install your package using pip: pip install <name of your package>

Related

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

Error of Installing dlib in anaconda

I'm trying to install Dlib in anaconda python with this line:
conda install -c menpo dlib
and I'm getting error like this:
UnsatisfiableError: The following specifications were found to be in conflict:
- dlib
- xlwt
Use "conda info <package>" to see the dependencies for each package.
How can I solve this problem?
Path of core-meta: C/users/{xxx}/anaconda3/core-meta
Delete core-meta then run the following commands:
Conda update --all
Conda install dlib
These commands require an internet connection so keep wifi on during the command running process.
Here xxx is the username on your computer.
If you do not need the xlwt-package for your project, just create a new conda environment and install the dlip package locally in that environment.
you can also try following:
brew install cmake
brew install boost
then create a virtual environment using conda command
conda create -n dlib python=3.6 anaconda
Activate the environment
source activate dlib
run the following command
conda install pip
and finally install dlib using below command
pip install dlib
This worked for me.
For anaconda or miniconda3, please see the following installation procedures. It will comply with Python 3.7 in this way.
1.Install cmake with git
$ sudo apt-get install git cmake
2. Enter into the the directory
Please change user to your own username
$ cd /home/user/dlib
3. Compile dlib
$ python setup.py install
If meeting with the issue that you could not put the import statements of setuptools behind the import statement of distutils, please change the placement oder in setup.py in the directory of dlib.
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
from distutils import log
from distutils.version import LooseVersion
4. Run the dlib unit test suite in the current working directory
Please note there is a sub-directory of dlib inlcuded in the directory of dlib.
$ cd dlib/test
$ mkdir build
$ cd build
$ cmake ..
$ cmake --build . --config Release
$./dtest --runall
Cheers.
on mac system :
you have to do it via brew
brew install cmake
brew install boost
brew install boost-python --with-python3
After installing above packages if you need you can create your environment and proceed with dlib installation or you can simply run next step.
The dlib library doesn’t have any real Python prerequisites, but if you plan on using dlib for any type of computer vision or image processing, These are few libraries which you can install for dlib :
* NumPy
* SciPy
* scikit-image
pip install numpy
5 pip install Scipy
pip install scikit-image
pip install dlib
you can check for more details on this link:
https://www.pyimagesearch.com/2017/03/27/how-to-install-dlib/
You have to try by putting just:
conda install dlib

Cannot Install Apple Turi Create

While installing Turicreate using pip on my macOS it gave me an error,
Could not find a version that satisfies the requirement turicreate (from versions: )
No matching distribution found for turicreate
I did the following steps:
conda create -n venv python=2.7 anaconda
source activate venv
pip install -U turicreate
pip install --upgrade pip
Requirement already up-to-date: pip in ./anaconda/lib/python3.5/site-packages
Although you create your venv virtual environment with python=2.7, the message you get when trying to upgrade pip indicates that you are running it in Python 3.5; the path
./anaconda/lib/python3.5/site-packages
clearly refers to the base Anaconda installation, and not to your venv virtual environment.
Given that, the error message you get is not unexpected, since Turicreate is not yet available for Python 3.5:
System Requirements
Python 2.7 (Python 3.5+ support coming soon)
x86_64 architecture

Cannot install libxml2 on python - Linux/Windows

I am new to python and am trying to use the libxml2 package.
This is what I get:
Executed command:
pip install libxml2-python
Error occurred:
Non-zero exit code (1)
Command output:
Collecting libxml2-python
Could not find a version that satisfies the requirement libxml2-python (from versions: )
No matching distribution found for libxml2-python
I am using Kali Linux amd_64, although I have tried on Windows 7 64 and get the same error. I've tried 32 and 64 bit versions of Python 2.7, 3.5.3, 3.6. I am using PyCharm. I have added it to the requirements.txt, tried to add it from there, as well as in both venv and non-venv with different python versions.
I've tried installing it locally, I've tried pip install and easy install, as well as pip install ftp://xmlsoft.org/libxml2/python/libxml2-python-2.6.9.tar.gz
I also installed Anaconda, thinking that would sort it, as it comes with libxml2 pre-installed. When I try to import it in anaconda, I get:
Executed command:
Conda /root/anaconda3/bin/conda install -p /root/anaconda3 libxml2-python==2.6.21 -y
Error occurred:
PackageNotFoundError: Package not found: '' Package missing in current linux-64 channels:
Command output:
PackageNotFoundError: Package not found: '' Package missing in current linux-64 channels:
- libxml2-python ==2.6.21
You can search for packages on anaconda.org with
anaconda search -t conda libxml2-python
You may need to install the anaconda-client command line client with
conda install anaconda-client
The anaconda client is installed.
Also:
conda install -p /root/anaconda3 libxml2 -yFetching package metadata .........
Solving package specifications: .
# All requested packages already installed.
# packages in environment at /root/anaconda3:
#
libxml2 2.9.4 0
Any suggestions are welcome, please help!

Install psycopg2 for Anaconda Python

I have Anaconda Python 3.4, however whenever I run older code I switch to Anaconda Python 2.7 by typing "source activate python2". My issue is that I have psycopg2 installed for Anaconda Python 3.4, but not for Anaconda Python 2.7. When I run pip install psycopg2 (on Python 2.7) I get the following message:
Error: pg_config executable not found.
Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
I am fairly new to programming and need help in:
1. Obtaining directory containing pg_config
2. Finding the path to Anaconda Python 2.7
3. Adding pg_config to the PATH.
After I complete these steps I should be able to pip install Install psycopg2
If you have anaconda, you can sidestep some of these headaches.
You said you have the Anaconda distribution of python and a quick look at the included packages shows that psycopg2 is already there (although not in the installer). You can simply:
source activate python2
conda install psycopg2
This allows the conda installer to manage all of the binary dependencies. Also makes it easier to upgrade.
If that does not work or there are reasons for not liking that package (version issues?) then that is a different question.
You need development system package for PostgreSQL which contains header files required to compile psycopg2 extension. For my CentOS 64 bit the command to install is:
yum install postgresql-devel.x86_64
but it depends on the OS - for Ubuntu that would be apt-get install ... - the name of the package varies slightly between distros.
Steps 2 and 3 should be unnecessary after you do this.
EDIT: For Mac OS that would be just:
brew install postgresql
as written here
env is the virtual environment created on Anaconda
once env is activated, type this in the terminal :
conda install -n env [package]
eg.
$ conda install -n env psycopg2
After this type python to enter the Anaconda shell, and then type:
import psycopg2
If it shows no error, it has successfully been installed.
I downloaded anaconda and looks like i have access to pip3
pip3 install psycopg2
As OP is using Anaconda, if one wants to install psycopg2, open CMD.exe Prompt for the environment that one will be working on and run
conda install -c anaconda psycopg2
# or
conda install psycopg2
(Source)
If one wants to install psycopg2-binary, then use
conda install -c conda-forge psycopg2-binary
# or
conda install psycopg2-binary
(Source)
Notes:
If the above didn't work, consider using pip as follows:
pip install psycopg2 (Source)
pip install psycopg2-binary (Source)
Note, however, that pip doesn't manage dependencies the same way conda does and can, potentially, damage one's installation.

Categories

Resources