How to install cvxopt on on windows 10 on python 3.6 - anaconda

How do I install cvxopt on windows 10 on python 3.6?
When running
conda install cvxopt
Fetching package metadata ...........
Solving package specifications: .
UnsatisfiableError: The following specifications were found to be in conflict:
- cvxopt -> python 3.5*
- python 3.6*
Use "conda info <package>" to see the dependencies for each package.
I apologize i am on windows...
Any ideas?

After much trial and error, I found that we need to install both the numpy+mkl package and the appropriate cvxopt from:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
Download the file, then do the following:
1) in a command line go to the downloads folder
2) pip install "numpy-1.13.1+mkl-cp36-cp36m-win_amd64.whl"
3) pip install "cvxopt-1.1.9-cp36-cp36m-win_amd64.whl"

The library can be installed directly using pip
(qiskit) C:\Python37>pip install --upgrade --force-reinstall cvxopt
It downloads the below wheels
cvxopt-1.2.5-cp37-cp37m-win_amd64.whl (822 kB)
mkl-2019.0-py2.py3-none-win_amd64.whl (224.1 MB)
Successfully installed cvxopt-1.2.5 intel-openmp-2019.0 mkl-2019.0
You may have to set the Python path as well in the environment variable to get it working!

Related

pip install IBM_DB does not work on Ubuntu 22.04 python 3.8

I am trying to install ibm_db v3.1.2 on python 3.8.13 Ubuntu 22.04 (5.15.0-40-generic)
pip install ibm_db
Collecting ibm_db
Downloading ibm_db-3.1.2.tar.gz (1.1 MB)
|████████████████████████████████| 1.1 MB 5.5 MB/s
Installing build dependencies ... done
Getting requirements to build wheel ... done
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/tmp/tmpfv417hua/output.json'
Other commands, such as pip install numpy work as expected
Any help would be appreciated.
Edit: I was able to work around the problem using Anaconda.
conda install -c conda-forge ibm_db. Now the basic use of ibm_db
ibm_db.pconnect(connection_string, "", "")
throws the error
[IBM][CLI Driver] SQL10013N The specified library "GSKit Error: 207" could not be loaded. SQLSTATE=42724 SQLCODE=-10013
which also seems to be known, but the suggested solution does not work.
Edit 2: pip3 install 'ibm_db==3.1.1' worked, so the problem may be with 3.1.2

Error installing geopandas in python on mac m1

I'm trying to install geopandas on my M1 mac and I'm running into errors
I tried to pip install all the dependencies individually but where I'm tripping up is in the install of pyproj.
I installed PROJ using brew install proj and that worked fine
When I try to pip install pyproj, I get the follow error
Building wheels for collected packages: pyproj
Building wheel for pyproj (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pyproj (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
PROJ_DIR is set, using existing PROJ installation..
running bdist_wheel
running build
running build_py
running build_ext
building 'pyproj._geod' extension
pyproj/_geod.c:704:10: fatal error: 'geodesic.h' file not found
#include "geodesic.h"
^~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyproj
Failed to build pyproj
ERROR: Could not build wheels for pyproj, which is required to install pyproject.toml-based projects
Any help would be much appreciated
At the moment, installing geopandas on M1 macs can be achieved via conda or pip+homebrew.
GeoPandas itself is written in pure Python, so there is no issue running that on any architecture. However, it depends on other libraries that are written in other languages (C, C++) that need to be compiled specifically for M1 chips. While you could compile it yourself, I am not going to cover this option as it is not user friendly.
There are three possible sources of required libraries - pip wheels, conda-forge, and Homebrew.
When a Python package requires C dependency, it can create wheels with the dependency compiled for each system and chip architecture. See for example pygeos - https://pypi.org/project/pygeos/#files. What you need is *macosx_11_0_arm64.whl . If your package doesn't offer it, you have to find another way of installing than pip. Since GeoPandas requires shapely and fiona (among others) that do not have these wheels, you should look elsewhere - either on conda-forge or Homebrew. Below are both options tested as of today.
Conda and conda-forge way (recommended)
Conda-forge currently has all packages geopandas needs
Install M1 version of miniforge or mambaforge. It can be downloaded from here - https://github.com/conda-forge/miniforge.
conda install -c conda-forge geopandas pygeos
Note: if you install x86 (Intel) version of conda, it will run under Rosetta2 and install all packages using x86 architecture, meaning that everything will run under emulation. Try to avoid that.
Pip and Homebrew way
Homebrew can install C libraries compiled for M1. Python packages will find and use them.
Using an environment with Python 3.9
Install shapely:
brew install geos
export DYLD_LIBRARY_PATH=/opt/homebrew/opt/geos/lib/
pip install shapely
DYLD_LIBRARY_PATH is needed for shapely to find GEOS installation.
Install fiona:
brew install gdal
pip install fiona
Install pyproj:
brew install proj
pip install pyproj
Install geopandas and pygeos for speedups:
pip install pygeos
pip install geopandas
Note that this is a copy&paste of my own explanation given in https://github.com/geopandas/geopandas/issues/1816#issuecomment-1003093329.
Related https://github.com/pyproj4/pyproj/issues/1027
I was stuck with the same problem, I also tried setting the environment values for PROJ_DIR, PROJ_LIBDIR, PROJ_INCDIR but perhaps setting the values is causing the error, so closed the terminal and tried again and was able to install correctly

How can I install torch and torchvision with pip and python 3.8.3 on windows in an virtual environment?

I created a virtual environment for my project and I'm trying to install torch via pip.
pip install torch===1.5.1 torchvision===0.6.1 -f https://download.pytorch.org/whl/torch_stable.html
This gives me the error -
ERROR: Could not find a version that satisfies the requirement torch===1.5.1 (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
ERROR: No matching distribution found for torch===1.5.1
Some solutions recommend the use of conda, is it necessary? Can I not do it through just pip
You can try to install directly from the wheels files:
pip install https://download.pytorch.org/whl/cu102/torch-1.5.1-cp36-cp36m-win_amd64.whl
pip install https://download.pytorch.org/whl/cu102/torchvision-0.6.1-cp36-cp36m-win_amd64.whl

Unable to install coremltools

I am trying to convert a pb file to a coreml file. to do this i need to install coremltools. However, when i try to install it by pip it comes up with this error :
ERROR: Could not find a version that satisfies the requirement coremltools (from versions: none)
ERROR: No matching distribution found for coremltools
i have tried to install it in a python 2.7 environment, still no joy
pip install coremltools
Collecting coremltools
ERROR: Could not find a version that satisfies the requirement coremltools (from versions: none)
ERROR: No matching distribution found for coremltools
Rorys-MBP:~ roryhodgson$
The only reason I could found out that explains why this is happening is that coremltools require python 2.7, make sure you are running it pip --version. If you just typed pip install coremltools the chances are that your machine (assuming it is running macOS) pip command is running the default version of macOS python which probably is 3.5.2 or greater.
I could fix this issue by creating an environment in which my python version was 2.7:
pip install virtualenv
Create a virtual environment:
virtualenv --python=/usr/bin/python2.7 py27
Activate it:
source py27/bin/activate
Lastly, install coremltools:
pip install -U coremltools
When you are done just deactivate the environment running deactivate in the terminal and that's it.
All this is available at the following source: satoshi.blogs.com
If you install from GitHub, then you will not need to install Python 2.7 or fiddle with virtual environments.
pip install "git+https://github.com/apple/coremltools"
The code above will let you install coremltools by cloning the Git repository.

Installing tensorflow on anaconda/mac?

I can not find a solution to install tensorflow on anaconda/mac.
When i try: conda install tensorflow,
I get:
UnsatisfiableError: The following specifications were found to be in conflict:
- blaze -> numba -> numpy=1.13
- tensorflow
Use "conda info " to see the dependencies for each package.
I tried reinstalling numpy, and could not find any relevant documentation.
On mac use following command:
conda install -c conda-forge tensorflow
This will install the latest Tensorflow on your system. if you wish to upgrade it to newer version then you can use the following command
conda update -f -c conda-forge tensorflow
I have had success installing tensorflow through pip...
pip install tensorflow
or, if you have all of the proper libraries...
pip install tensorflow-gpu
But if you have already removed numpy form the anaconda install, you might be in for a long day because almost all of the numeric packages require it. If the above pip install doesn't work, you might want to start from a clean anaconda install.
I have installed tensorflow using -
pip install tensorflow
Or, you can use Anaconda in following way -
Open Anaconda Navigator
On Left side go to Environments
Create a new environment (eg :- tensorflow_tf), select python 3.7
then select Not installed and Search "tensorflow"
click on tensorflow and apply

Resources