I'm using Windows and my default python version is:
python --version
Python 3.6.5 :: Anaconda, Inc.
Unfortunately, Gurobi is choosing 2.7 for installation.
How to install it with python 3.6?
You are in good shape because you have anaconda installed on windows. If you follow the instructions you will have gurobi installed with your version of python. As of today, the instructions are
conda config --add channels http://conda.anaconda.org/gurobi
conda install gurobi
If you still have trouble, read on. From reading your question, it looks like you might also have gurobi installed separately but in your path. This is probably OK as long as it is the same version of gurobi or if the anaconda distribution is ahead of the gurobi installation. Also, if you used the setup.py or pip to try to install gurobi, you might run into trouble from mixing pip and conda. In the worst case, it might be easiest just to delete and reinstall conda.
Related
Closely related to Can I conda install an alpha or beta version of Python? but that question is about a specific version in conda-forge. If a Python release (e.g. 3.10.0b1) is available for download via https://www.python.org/download/pre-releases/ but not in the main anaconda or any other conda channel yet, what are my best bets for using it?
Open an issue at conda-forge?
Some generic conda install script to run the python installer inside an environment?
Something else...
Particularly with alpha/beta releases of Python, I'd like the protection of a conda environment for my installation. I'm worried about using the standard Python installer now as it might not play nicely, but maybe there are some mitigation measures I can take?
pyenv is probably the best way to manage Python installations (not to be confused with Python virtual environments). It can easily install and access alpha and beta versions of Python, or whatever other previous versions have been published.
Unfortunately, pyenv does not work in Windows outside the Windows Subsystem for Linux. Fortunately, you can use pyenv-win, which is a port of pyenv for Windows, and is recommended by the authors of pyenv. To install it, follow their installation instructions.
Once you've got it installed, you can run the following to install Python 3.10.0b1:
pyenv install 3.10.0b1
pyenv global 3.10.0b1
Note that alpha/beta releases are not permanent, so when you actually run these commands 3.10.0b1 may no longer be available. You can run pyenv update to update pyenv, which will inform it of the currently available versions. pyenv install 3.10.<TAB><TAB> will show you which versions of Python 3.10 can be installed.
You can test it by running:
python -V
You should get an output of Python 3.10.0b1 if everything is in order.
To use Conda with pyenv, see this answer: https://stackoverflow.com/a/58045984/5946921
I am using python 3.6 version and CPLEX 12.10 in MAC with Anaconda. How do I access the cplex libraries for python? I have an academic version installed in my MAC and can be used independently in GUI.
What do you want to use ? There are the CPLEX python api which is a python API to the
matrix interface of CPLEX - And there is docplex, which is the object oriented modeling
layer based on CPLEX.
In anycase, if running a solve showed the error of promotional version, then it means
that somehow you installed the cplex package in the past.
Before you start, please open a Terminal console and make sure it is setup to use
your installation of Anaconda, and that your conda environment is activated (if you use one).
First you want to install whatever cplex was installed using conda uninstall cplex if you installed using conda or pip uninstall cplex if you were using pip.
Then you have a choice. Either you add $CPLEX_STUDIO_DIR1210/cplex/python/3.6/x86-64_osx to your PYTHONPATH or you install the CPLEX python wrappers:
$ cd $CPLEX_STUDIO_DIR1210/cplex/python/3.6/x86-64_osx
$ python setup.py install
as said in http://ibmdecisionoptimization.github.io/docplex-doc/mp/getting_started_python.html
conda install -c ibmdecisionoptimization docplex
should help
On my Ubuntu 18.04, I have Python 3 and R installed. I am about to study some data science, and just found https://www.anaconda.com/distribution/.
anaconda comes with Python and R and some packages. Will installing anaconda conflict with my existing installation of Python 3 and R?
Shall I install anaconda, or shall I install the packages manually and individually on demand?
How do people in data science install the tools?
Thanks.
I have a system python and R as well as anaconda and they don’t seem to conflict and I have the same OS as you. Conda, the package and environment manager that comes with anaconda, supposedly does not mix well with pip, meaning if you have a virtual environment you should use one or the other. However, I have mixed them without any difficulties.
I prefer creating virtual environments the more standard way, but there are some scientific packages that are much easier to install using conda.
I am trying to use tensorflow but my python is to recent. I have python3.7.2 and I need py3.6 in order to install and use tensorflow.
I have installed py3.6.8 but I still can't install it with pip. Is there a way of interchanging between versions of python to install/use tensorflow. Or is it to do with my pip version?
The error is:
Could not find version that satisfies the requirement tensorflow in versions:
The main problem is that I don't know how to get tensorflow. Can someone help me do this?
By far the best option will be to use Anaconda virtual environment. After you install Anaconda, use environments to manage different versions of Python:
Python 3.6.8:
conda create -n myenv python=3.6.8 tensorflow
Python 3.7:
conda create -n myenv python=3.7 tensorflow
Why am I saying it's best with Anaconda? Long story short, it can be (much) faster. Here's an article that discusses why.
Option 1:
Install multiple versions in separate directories, and then you run the python program with the Python version you want to use. Like so:
C:\Python26\Python.exe thescript.py
What virtualenv does is that it gives you many separate "virtual" installations of the same python version. That's a completely different issue, and hence it will not help you in any way.
Option 2:
Use Pythonbrew.
Once pythonbrew is installed:
#to install new python versions is as simple as:
pythonbrew install 2.7.2 3.2
#to use a particular version in the current shell:
pythonbrew use 3.2
#to uninstall:
pythonbrew uninstall 2.7.2
I am trying to install the boost library as shown here (see section install Boost from Shayne Fletcher:
http://www.amazon.com/review/R2QLTSQPKTFW5Z/ref=cm_cr_pr_cmt?ie=UTF8&ASIN=0470987847#wasThisHelpful
However I already have installed the 64 bit version of Anaconda for Python 2.7.5. So when I follow the instructions above I get the similar linking errors to the OP experienced in the post below:
Cannot successfully install Boost.Python
The OP resolved the issue be removing the 64 bit version and replacing it with the 32 bit version.
However I wondered if I could install both versions and switch between them, it seems that generally speaking you can:
Anaconda Python 32-bit is trying to load Anaconda 64-bit libraries
to-load-anaconda-64-bit-libraries
However that sill leaves the question of how the boost library will know how to use the correct version and where to find it?
Or in my case would I still be better off removing the 64 bit version completely and installing the 32 bit version in its place?
I am doing the build in visual studio 2008.
If you install the 32-bit version of Anaconda, you can conda install boost.
As for how to switch between them, you will need to modify your PATH environment variable.
If you are using 64-bit version.
Open Anaconda prompt in Admin mode and run the following command
conda install -c anaconda boost
It will automatically resolve environment