Has virtualenv installed correctly when `pip install virtualenv` outputs `using cached virtualenv`? - macos

Context: Am working on the flaskr web project on Mac OS High Sierra.
Am at stage of installing Flask and I am running into issues with installing virtualenv: http://flask.pocoo.org/docs/0.12/tutorial/packaging/
When running the following line in Terminal:
pip install virtualenv
I get:
pip install virtualenv
Collecting virtualenv
Using cached virtualenv-15.2.0-py2.py3-none-any.whl
matplotlib 1.3.1 requires nose, which is not installed.
matplotlib 1.3.1 requires tornado, which is not installed.
matplotlib 1.3.1 has requirement numpy>=1.5, but you'll have numpy
1.8.0rc1 which is incompatible.
Installing collected packages: virtualenv
I was expecting a response 'successfully installed virtualenv...' as appears in this video: https://youtu.be/-COGZITgHtw?t=1m9s.
Then, when running the following in Terminal:
virtualenv
I get:
-bash: virtualenv: command not found
I note others have had issues with ‘command not found’ (bash: pip: command not found, How to add virtualenv to path) but I cannot seem to find outputs which mirror what I have received.
Is the cached virtualenv holding things up? Or perhaps the matplotlib stuff? Either way, virtualenv doesn't appear to have installed as it ought.
Would it be wise (in any case) to update or install nose, tornado and numpy using pip so that I can progress to activating a virtualenv? Or is something I need to address first before I can get virtuanlenv to start working?

I did the same error, but succeeded with the following procedure.
$ brew install python3
$ pip3 install --upgrade virtualenv
Collecting virtualenv
Cache entry deserialization failed, entry ignored
Cache entry deserialization failed, entry ignored
Downloading virtualenv-15.2.0-py2.py3-none-any.whl (2.6MB)
100% |████████████████████████████████| 2.6MB 226kB/s
Installing collected packages: virtualenv
Successfully installed virtualenv-15.2.0

Related

How to install AutoKeras on aws-ec2

I tried to install autokeras on aws ec2 (p2.xlarge) with the environment python 3.6 & tensorflow. I get following error after "pip install autokeras":
tensorflow 1.10.0 has requirement numpy<=1.14.5,>=1.13.3, but you'll have numpy 1.15.4 which is incompatible.
Installing collected packages: imageio, autokeras
Found existing installation: imageio 2.3.0
Cannot uninstall 'imageio'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
I uninstalled numpy 1.15.4 and installed numpy 1.14.5. With "conda list", I can see the numpy has the correct version.
But after "pip install autokeras" I get the same error and numpy 1.15.4 is still there.
Has anyone successfully installed autokeras on aws ec2? What shall I do to install autokeras correctly?
(Maybe the 'imageio' is the next problem?)
Thank you!
I think you need tensorflow 1.14. Here my notes for AutoKeras installation:
Autokeras Installation Notes in the Deep Learning AMI:
We launched a new deep learning AMI with ubuntu.
The deep learning AMI didn't worked using the "tensorflow + keras + py3.6" environment (so no need for a DL AMI probably, you can save space on disk using a normal clean AMI), so we managed o install autokeras doing the following:
Create a new environment with Anaconda: $ conda create -n autokeras python=3.6.
1.1. Remember that only python 3.6 is working with autokeras
Activate virtual env: It didn't work $ conda activate autokeras, but it works using $ source activate autokeras.
installation of all the packages as required by pyimagesearch.
3.1. A new problem arised here, which, long story short, was solved using the next post (note that I chenged the order, since urllib3 needs jsonschema to be installed first):
$ pip uninstall urllib3```
$ pip uninstall jsonschema
$ pip install jsonschema==2.6.0
$ pip install urllib3==1.24.1
3.2. Finally I was able to install all 3 packages:
$ pip install tensorflow # or tensorflow-gpu
$ pip install keras
$ pip install autokeras
3.3. Autokeras worked fine at this point, but it raised a warning:
>>> import autokeras
Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex
So I just went to the webpage and followed the installation steps. Now it works without warnings (so far):
$ git clone https://github.com/NVIDIA/apex
$ cd apex
$ pip install -v --no-cache-dir --global-option="--pyprof" --global-option="--cpp_ext" --global-option="--cuda_ext" ./

Basemap install on mac without fink (I tried everything I can google)

I am a Python Noob. (Using Mac OS 10.12 & Python 3.7)
I'm trying to use mpl_toolkits.basemap
to execute the code
from mpl_toolkits.basemap import Basemap
I googled the way to get matplotlib and successfully installed it.
However, while it's possible to run "from mpl_toolkits.basemap import Basemap" in terminal on mac,
it fails to be loaded if I run the command within IDLE.
Then, I googled to figure out the issue and got the hint that
it could be resolved if I install Basemap properly.
To install Basemap, I think I need to go with "FINK".
However, Fink is only available up to 10.5 OS while mine is 10.12.
And FINK website says do not update OS before upgrading FINK.
However, it's too late for me.
Cause I updated my OS longtime ago and recently I started to learn Python Using Mac.
So I guess, if there is a way to install Basemap not using apt-get,
(the codes below is from "Python basemap module impossible to import")
sudo apt-get install libgeos-3.5.0
sudo apt-get install libgeos-dev
sudo pip install https://github.com/matplotlib/basemap/archive/master.zip
I think my issue could be cleared.
Since I'm really really noob, I'm not sure this is the reason for my failing in "from mpl_toolkits.basemap import Basemap".
What I tried so far is
1) brew install basemap
with the error of
Error: No available formula with the name "basemap"
==> Searching for a previously deleted formula (in the last month)... Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
2) pip install basemap
with the error of
Requirement already satisfied
3) sudo pip install https://github.com/matplotlib/basemap/archive/master.zip
with the error of
Command "python setup.py egg_info" failed with error code 1 in
/private/tmp/pip-install-lux494o4/pyproj/
4) conda install basemap
with the following message of
All requested packages already installed.
5) conda install -c conda-forge basemap
with the following message
Preparing transaction: done Verifying transaction: done Executing
transaction: done
Can anyone help to install basemap properly so that I could run
"from mpl_toolkits.basemap import Basemap"
in my IDLe?
My IDLE Sheel keeps saying
Traceback (most recent call last): File "", line 1, in
from mpl_toolkits.basemap import Basemap ModuleNotFoundError: No module named 'mpl_toolkits.basemap'
while my terminal doesn't have problem with running the code.
Appreciate it in advance.
any luck? I spent the day battling this as well. I had the most success when I tried downloading an older version of basemap.
I was using python 2.7 and this worked okay sudo -H pip2 install https://github.com/matplotlib/basemap/archive/v1.1.0.tar.gz
For python 3 try replacing pip2 with pip3 or pip.
Ran into this myself today my solution:
install libgeos on mac
brew install geos
then as you suggested use pip to install mpl_tools:
pip3 install -q https://github.com/matplotlib/basemap/archive/master.zip
This also may help:
missing libgeos_c.so on OSX
Firstly, I suggest you to set Anaconda up. Then follow below steps;
Create a new environment in anaconda.
Install Jupyter Notebook and launch it. If it works, turn it off.
Change your anaconda environment in your terminal.
Try installation commands below;
conda install ...
conda install forge ...
pip install ...

Using pip to install iPython Notebook

Edit:
According to the pip website (https://pip.pypa.io/en/stable/installing), I should already have pip installed with my Python version 2.9.7, but I assumed that I don't because of the error message.
I then attempted to install pip by downloading get-pip.py. It was successful but I got the messages:
Found existing installation: pip 1.3.1
Uninstalling pip-1.3.1:
Successfully uninstalled pip-1.3.1
Successfully installed pip-8.1.1 wheel-0.29.0
So it seems I did have a version of pip, so I'm not sure why I was getting the error message described in my original post.
But when I tried to then pip install jupyter, I just get:
-bash: pip: command not found
again. Can someone tell me what I'm doing wrong please?
I need to install iPython Notebook. I already have Python (version 2.7.9) installed on my Macbook, running OS X (version 10.7.5).
After some initial investigation, I saw somebody say that I could just run:
pip install "ipython[notebook]"
When I did this however, I got:
-bash: pip: command not found
So do I have to install pip first? And then use pip to install the Notebook? I'm out of my depth and a little confused!
Okay so my problem was that pip was installed, but in a location that was not included in my $PATH variable.
One of the answers here is relevant.

Installing Tensorflow with Python 3.5 and Anaconda

I have Anaconda 3.19.3 with Python 3.5 on a Mac. Now, I would like to install TensorFlow via pip. The installation instructions here also include setup instructions for installing TensorFlow under Python 3.3+.
So, I have executed sudo easy_install --upgrade six, no problem. When I execute sudo pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.7.0-py3-none-any.whl, after downloading the necessary packages, I get the following:
Installing collected packages: setuptools, protobuf, tensorflow
Found existing installation: setuptools 19.6.2
Uninstalling setuptools-19.6.2:
Successfully uninstalled setuptools-19.6.2
Rolling back uninstall of setuptools
Exception:
...
AttributeError: _ep_map
During handling of the above exception, another exception occurred:
...
FileNotFoundError: [Errno 2] No such file or directory: '/Users/me/anaconda/lib/python3.5/site-packages/setuptools-19.6.2-py3.5.egg'
I have left out some of the error message to save space.
What is this and, more importantly, what can I do about it?
See the answer here:
Error setuptools when installing tensorflow
In particular, you could try adding the --ignore-installed tag to the end of your pip command.

Cannot install pip for python3 on mac

When I run
curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
sudo python3 get-pip.py
It gives me this error:
Downloading/unpacking pip
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement pip
Cleaning up...
No distributions at all found for pip
Storing debug log for failure in /var/root/.pip/pip.log
However if I just run:
sudo python get-pip.py
There is no problem:
Downloading/unpacking pip from https://pypi.python.org/packages/py2.py3/p/pip/pip-1.5.2-py2.py3-none-any.whl#md5=445a893564065937c0f31ac2cc8e2f35
Downloading pip-1.5.2-py2.py3-none-any.whl (1.2MB): 1.2MB downloaded
Installing collected packages: pip
Found existing installation: pip 1.5.1
Uninstalling pip:
Successfully uninstalled pip
Successfully installed pip
Cleaning up...
Can anyone help please? Thanks!
This is a simple permissions issue. If you're installing to the system Python installation, you should need root, which is what sudo provides.
If you need to install stuff where you don't have root privileges, you need to look into Python virtual environments.

Resources