Cannot Install Apple Turi Create - python

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

Related

Install Tensorflow in MacOs M1

I am struggling to install tensorflow on MacOS Monterey 12.5.1 with M1 Chip
pip3 install tensorflow-macos
pip3 install tensorflow-metal
I keep getting this error: ERROR: Could not find a version that satisfies the requirement python (from versions: none)
I tried venv, I tried miniconda, anaconda, still same issue.
How can I install tensorflow in M1 MacOS ?
You can follow installation instructions from the apple developer website.
With conda first, you need to install tensorflow-deps with:
conda install -c apple tensorflow-deps
then
python -m pip install tensorflow-macOS
python -m pip install tensorflow-metal
This is the procedure recommended by apple, so if you haven't installed "tensorflow-deps", first try that.
Also this is suggested for your problem in the same webpage:
Error: “Could not find a version that satisfies the requirement
tensorflow-macos (from versions: none).” A TensorFlow installation
wheel that matches the current Python environment couldn’t be found by
the package manager. Check that the Python version used in the
environment is supported (Python 3.8, Python 3.9, Python 3.10).
So try using the mentioned Python versions.
Also, here is the long thread of people facing different issues with TensorFlow on mac, which helped me a lot.
brew install python#3.8
/opt/homebrew/Cellar/python#3.8/3.8.16/bin/python3.8 -m venv ~/TF
source ~/TF/bin/activate
pip install --upgrade pip
pip install tensorflow-macos

Terminal has different Python version in PyCharm

My current Python version is 3.8, but I do also have python 3.6 installed in another directory. My IDE is PyCharm. I set up a new project using version 3.6 so I can use an older version of Tensorflow, namely Tensorflow==2.0.0b1. However, when using pip install on this project it still recognizes version 3.8. My question is how can I pip install to my my 3.6 directory and not the 3.8 site packages folder.
Here is the error:
C:\Users\my_folder_name\PycharmProjects\Anomaly_Dectection>pip install tensorflow==2.0.0
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement tensorflow==2.0.0
ERROR: No matching distribution found for tensorflow==2.0.0
WARNING: You are using pip version 21.0.1; however, version 21.2.1 is available.
You should consider upgrading via the 'c:\program files\python38\python.exe -m pip install --upgrade pip' command.
I need the pip install to go here:
C:\Users\folder_name\AppData\Local\Programs\Python\Python36\Lib\site-packages
P.S: I set up a venv with Python 3.6 for this new project.
It should work, when you run pip from the script folder:
C:\Users\folder_name\AppData\Local\Programs\Python\Python36\Scripts
If there is no pip3 in your current directory, windows is looking at your PATH variable and i guess, it takes pip3 from the newest python, not 3.6.

local pip in conda environment checks globally and says Requirement already satisfied

create virtual environment conda create test python=3.7
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /Users/mac/miniconda3/envs/test
added / updated specs:
- python=3.7
The following NEW packages will be INSTALLED:
ca-certificates pkgs/main/osx-64::ca-certificates-2019.10.16-0
certifi pkgs/main/osx-64::certifi-2019.9.11-py37_0
libcxx pkgs/main/osx-64::libcxx-4.0.1-hcfea43d_1
libcxxabi pkgs/main/osx-64::libcxxabi-4.0.1-hcfea43d_1
libedit pkgs/main/osx-64::libedit-3.1.20181209-hb402a30_0
libffi pkgs/main/osx-64::libffi-3.2.1-h475c297_4
ncurses pkgs/main/osx-64::ncurses-6.1-h0a44026_1
openssl pkgs/main/osx-64::openssl-1.1.1d-h1de35cc_3
pip pkgs/main/osx-64::pip-19.3.1-py37_0
python pkgs/main/osx-64::python-3.7.5-h359304d_0
readline pkgs/main/osx-64::readline-7.0-h1de35cc_5
setuptools pkgs/main/osx-64::setuptools-42.0.1-py37_0
sqlite pkgs/main/osx-64::sqlite-3.30.1-ha441bb4_0
tk pkgs/main/osx-64::tk-8.6.8-ha441bb4_0
wheel pkgs/main/osx-64::wheel-0.33.6-py37_0
xz pkgs/main/osx-64::xz-5.2.4-h1de35cc_4
zlib pkgs/main/osx-64::zlib-1.2.11-h1de35cc_3
check the reference of pip, which is correct.
(test) mac#mac-MBP ~ % which pip
/Users/mac/miniconda3/envs/test/bin/pip
(test) mac#mac-MBP ~ % pip --version
pip 19.3.1 from /Users/mac/miniconda3/envs/test/lib/python3.7/site-packages/pip (python 3.7)
install pip install jupyter
shows
Requirement already satisfied: jupyter in ./.local/lib/python3.7/site-packages (1.0.0)
I can use conda to uninstall and reinstall pip, which will solve the Requirement already satisfied issue, but it also upgrades python3.7 to 3.8 for some reason. I have to use 3.7 because tensorflow currently only supports 3.7.
Not sure what's wrong here. I have used the same commands to create environment and also worked smoothly. The only change I can think of is that I changed from bash to zsh because of Catalina. Any help would be appreciated.
The issue was I installed Jupyter with --user flag before, so the package was installed in the user directory outside of the conda env directory. pip list --user shows these packages.
The solution is to uninstall these packages first.
pip freeze --user > packages.txt
pip uninstall -r packages.txt
You can call the pip with the python version you want to install the package for. For more detail please go through the link am pasting below:
Install a module using pip for specific python version
and do not forget to restart your anaconda after installing.
Hope it'll solve your issue

inconsistent pip version in PyCharm

I'm using PyCharm on Windows. I have a project setup for small experiments with algorithms that uses it's own virtual environment. I was trying to install tensorflow and I got an error that I'm running pip 10.0.1 and should upgrade to 18.1, which I did through "File/Settings/Project Interpreter". It now says 18.1. But I'm still getting warnings about using version 10.0.1.
(venv) C:\users\xxx\pycharmprojects\so> pip list
...
pip 10.0.1
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
(venv) C:\users\xxx\pycharmprojects\so>python -m pip install --upgrade pip
Requirement already up-to-date: pip in c:\users\xxx\pycharmprojects\so\venv\lib\site-packages (18.1)
(venv) C:\users\xxx\pycharmprojects\so> pip list
...
pip 10.0.1
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
(venv) C:\users\xxx\pycharmprojects\so>python -m pip list
...
pip 18.1
After a bit of discussion, we've got the problem solved.
Here's what was wrong:
PyCharm is unable to properly update pip under Windows while using virtualenv (possible bug/issue)
The reason why installation of Tensorflow was failing at first place was that it strictly requires Python3.5 under Windows, while the problem occured with Python3.7, so switching to Python3.5 VirtualEnv in PyCharm solved the issue.
NOTE: No pip update was required in order to install Tensroflow with Pycharm + Python3.5 venv
It has happened to me after upgrading to Python 3.7.1 and pip 19.0.3.
It was solved after making sure that both new Python installation folder and corresponding Scripts folder are included in the PATH environment variable prior to creating a new virtual environment for my project.

venv vs virtualenv - Why does venv not use the current pip and setuptools? [duplicate]

This question already has answers here:
Why 'python3 -m venv myenv' installs older version of pip into myenv than any version of pip I can find anywhere on the system?
(3 answers)
Closed 3 years ago.
When using python -m venv env to create a new virtual environment in python3.X, env does not contain the pip and setuptools versions I would expect. Instead, it contains quite "old" versions: pip (8.1.1) and setuptools (20.7.0) as of June 2018.
On the other hand, when using virtualenv env (installed via pip install virtualenv), the pip and setuptools packages are the latest available, i.e. pip (10.0.1) and setuptools (39.2.0) as of June 2018.
The way I understood it, venv is the preferred module to build virtual environments because it does not need to create a new instance of the Python interpreter and uses the present modules (symlinks in Linux, copies in Windows) without needing to install anything ( https://www.reddit.com/r/learnpython/comments/4hsudz/pyvenv_vs_virtualenv/d2s2cda ).
How come that venv's pip version doesn't match the current system's one? And that the behaviour using virtualenv is so different?
PS:
A short term solution is to use pip install --upgrade pip in the env. But that doesn't seem right to me. Minimum viable solution:
$ python --version
Python 3.6.5
$ pip --version
pip 10.0.1 from /home/lionel/.local/lib/python3.6/site-packages/pip (python 3.6)
$ python -m venv env
$ . env/bin/activate
(env) $ # Here I am at version 8.1.1 of pip. Why did venv create its own pip,
(env) $ # instead of linking to the system one? As seen before, that was 10.0.1.
(env) $ pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 8.1.1
Uninstalling pip-8.1.1:
Successfully uninstalled pip-8.1.1
Successfully installed pip-10.0.1
(env) $ pip list
Package Version
------------- -------
pip 10.0.1
pkg-resources 0.0.0
setuptools 20.7.0
(env) $ # Solved, now pip is the one I was expecting!
Not trying to revive an old thread, but here is the answer i found to why this happens when using venv- short answer-
venv calls ensurepip.version() to get the version- that gets the bundled pip version.
Credits to original answer from here:

Categories

Resources