I am trying to install Sphinx on OSX, with the hopes of eventually making it into a website, following this guide :
I have been macporting, homebrewing, python wheelin', figuring out what a virtualenv is... figuring out if I should use python 2.7 or 3.X (which I couldn't figure out)
I added this to my bash profile :
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/site-packages
When I run this :
python -c "import sys; print('\n'.join(sys.path))"
I had expected it to return simply /usr/local/lib/python2.7/site-packages
but it says the following :
/Library/Python/2.7/site-packages/pip-10.0.0b2-py2.7.egg
/Library/Python/2.7/site-packages/virtualenv-15.2.0-py2.7.egg
/Users/nook
/usr/local/lib/python2.7/site-packages
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
/Users/nook/Library/Python/2.7/lib/python/site-packages
/Library/Python/2.7/site-packages
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
Anyway, I finally got a virtualenv set-up, and ran the following command:
pip install sphinx
I sorted out a NumPy error, and another error with six. But I am unable to get rid of the following error :
jupyter-client 5.2.3 has requirement python-dateutil>=2.1,
but you'll have python-dateutil 1.5 which is incompatible.
When I run the following command :
pip install python-dateutil --upgrade --ignore-installed
I get
Collecting python-dateutil
Using cached python_dateutil-2.7.2-py2.py3-none-any.whl
Collecting six>=1.5 (from python-dateutil)
Using cached six-1.11.0-py2.py3-none-any.whl
Installing collected packages: six, python-dateutil`
That seems good...
But when I try to install sphinx again I get the same
jupyter-client 5.2.3 has requirement python-dateutil>=2.1, but you'll have
python-dateutil 1.5 which is incompatible.
So I went in and tried the following command :
sudo rm -rf /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/python_dateutil-1.5-py2.7.egg-info/
I want to remove that directory, to NumPy directories, and another dateutil directory...but can't ! I don't have the permissions.
If anyone has a pro-tip on what version of python to use for my sphinx site (the latest version ?), and how set up a virtual environment with **that version of python, figure out Numpty and dateutil... I will be forever in your debt !
EDIT : Just tried the following :
sudo pip install python-dateutil
Password:
The directory '/Users/nick/Library/Caches/pip/http' or its parent directory is
not owned by the current user and the cache has been disabled. Please check
the permissions and owner of that directory. If executing pip with sudo, you
may want sudo's -H flag.
The directory '/Users/nick/Library/Caches/pip' or its parent directory is not
owned by the current user and caching wheels has been disabled. check the
permissions and owner of that directory. If executing pip with sudo, you may
want sudo's -H flag.
Requirement already satisfied: python-dateutil in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
(1.5)
pandas 0.22.0 has requirement numpy>=1.9.0, but you'll have numpy 1.8.0rc1
which is incompatible.
matplotlib 1.3.1 has requirement numpy>=1.5, but you'll have numpy 1.8.0rc1
which is incompatible.
jupyter-client 5.2.3 has requirement python-dateutil>=2.1, but you'll have
python-dateutil 1.5 which is incompatible.
You can see my numpy is totally budget too, at 1.8.0rc1. Thanks.
Related
I am starting to use VS Code, but pylint is not installed and it gives me an error.
I try to install pylint using pip, but it gives me an error code.
Collecting pylint
Using cached pylint-2.6.0-py3-none-any.whl (325 kB)
Collecting astroid<=2.5,>=2.4.0
Using cached astroid-2.4.2-py3-none-any.whl (213 kB)
Collecting colorama
Using cached colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Collecting isort<6,>=4.2.5
Using cached isort-5.6.4-py3-none-any.whl (98 kB)
Collecting lazy-object-proxy==1.4.*
Using cached lazy-object-proxy-1.4.3.tar.gz (34 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
WARNING: Requested lazy-object-proxy==1.4.* from https://files.pythonhosted.org/packages/07/3f/a3d687f83c7d44970f70ff0400677746c8860b11f0c08f6b4e07205f0cdc/lazy-object-proxy-1.4.3.tar.gz#sha256=f3900e8a5de27447acbf900b4750b0ddfd7ec1ea7fbaf11dfa911141bc522af0 (from astroid<=2.5,>=2.4.0->pylint), but installing version 0.0.0
ERROR: Requested lazy-object-proxy==1.4.* from https://files.pythonhosted.org/packages/07/3f/a3d687f83c7d44970f70ff0400677746c8860b11f0c08f6b4e07205f0cdc/lazy-object-proxy-1.4.3.tar.gz#sha256=f3900e8a5de27447acbf900b4750b0ddfd7ec1ea7fbaf11dfa911141bc522af0 (from astroid<=2.5,>=2.4.0->pylint) has different version in metadata: '0.0.0'```
This is a bug of pip for now, see https://github.com/pypa/pip/issues/9203. The pip does something wrong in its package-dependencies handling. And there is a workaround listed in this issue, use --use-deprecated=legacy-resolver. And be noted: This will work until we release pip 21.0.
So run pip install --use-deprecated=legacy-resolver pylint will resolve this problem. This works for me on win10, finally I got lazy-object-proxy 0.0.0 and pylint 2.6.0 installed, though 0.0.0 is kinda weird.
I had the same issues with Python 3.9 & Pylint.
Even when I tried the answers given here, nothing worked. I kept on getting Error messages.
All my issues where fixed by doing the following:
Uninstalled Python 3.9.1
Installed Python 3.7.9 - (Remember to click the box add to PATH)
Verifying Python Installation:
3.1 python --version, This should give you Python 3.7.9
If it doesn't and you get an Error, you need to configure your PATH, here is a video on how to fix that:
https://www.youtube.com/watch?v=vWxQG70GqT4&list=PL914uJ85wHwJ4WYvHEhPHSgG2oyi7Azat&index=11&ab_channel=KyleCook
Verifying pip Installation:
4.1 pip --version (I got another Error here again)
i.e.: ModuleNotFoundError: No module named 'pip' python3
I fixed that by:
4.1.1 python -m ensurepip
4.1.2 python -m pip install --upgrade pip
Ref: ModuleNotFoundError: No module named 'pip' python3
Install Pylint for Python 3.6+:
5.1 pip install pylint --upgrade
Ref: https://pypi.org/project/pylint/
This worked for me.
I am trying to update pandas within a lifecycle configuration, and following the example of AWS I have the next code:
#!/bin/bash
set -e
# OVERVIEW
# This script installs a single pip package in a single SageMaker conda environments.
sudo -u ec2-user -i <<EOF
# PARAMETERS
PACKAGE=pandas
ENVIRONMENT=python3
source /home/ec2-user/anaconda3/bin/activate "$ENVIRONMENT"
pip install --upgrade "$PACKAGE"==0.25.3
source /home/ec2-user/anaconda3/bin/deactivate
EOF
Then I attach it to a notebook and when I enter the notebook and open a notebook file, I see that pandas have not been updated. Using !pip show pandas I get:
Name: pandas
Version: 0.24.2
Summary: Powerful data structures for data analysis, time series, and statistics
Home-page: http://pandas.pydata.org
Author: None
Author-email: None
License: BSD
Location: /home/ec2-user/anaconda3/envs/python3/lib/python3.6/site-packages
Requires: pytz, python-dateutil, numpy
Required-by: sparkmagic, seaborn, odo, hdijupyterutils, autovizwidget
So we can see that I am indeed in the python3 env although the version is 0.24.
However, the log in cloudwatch shows that it has been installed:
Collecting pandas==0.25.3 Downloading https://files.pythonhosted.org/packages/52/3f/f6a428599e0d4497e1595030965b5ba455fd8ade6e977e3c819973c4b41d/pandas-0.25.3-cp36-cp36m-manylinux1_x86_64.whl (10.4MB)
2020-02-03T12:33:09.065+01:00
Requirement already satisfied, skipping upgrade: pytz>=2017.2 in ./anaconda3/lib/python3.6/site-packages (from pandas==0.25.3) (2018.4)
2020-02-03T12:33:09.065+01:00
Requirement already satisfied, skipping upgrade: python-dateutil>=2.6.1 in ./anaconda3/lib/python3.6/site-packages (from pandas==0.25.3) (2.7.3)
2020-02-03T12:33:09.065+01:00
Requirement already satisfied, skipping upgrade: numpy>=1.13.3 in ./anaconda3/lib/python3.6/site-packages (from pandas==0.25.3) (1.16.4)
2020-02-03T12:33:09.065+01:00
Requirement already satisfied, skipping upgrade: six>=1.5 in ./anaconda3/lib/python3.6/site-packages (from python-dateutil>=2.6.1->pandas==0.25.3) (1.13.0)
2020-02-03T12:33:09.065+01:00
Installing collected packages: pandas Found existing installation: pandas 0.24.2 Uninstalling pandas-0.24.2: Successfully uninstalled pandas-0.24.2
2020-02-03T12:33:12.066+01:00
Successfully installed pandas-0.25.3
What could be the problem?
if you want to install the packages only in for the python3 environment, use the following script in your Create Sagemaker Lifecycle configurations.
#!/bin/bash
sudo -u ec2-user -i <<'EOF'
# This will affect only the Jupyter kernel called "conda_python3".
source activate python3
# Replace myPackage with the name of the package you want to install.
pip install pandas==0.25.3
# You can also perform "conda install" here as well.
source deactivate
EOF
Reference : "Lifecycle Configuration Best Practices"
I have encountered the exact same problem when package was not available in the notebook while Lifecycle Cloudwatch indicated successful installation for the specific kernel. The solution that worked for me is to make sure installation completes before opening up notebook.
I am very new to coding and don't understand install processes. I am using Python 3.7.0 on Max OSX El Capitan. I want to install matplotlib but I tried this in terminal :
$ pip install matplotlib
and it gave me an error that :
192-168-1-107:~ Ada1$ pip install matplotlib Requirement already satisfied: matplotlib in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
Requirement already satisfied: numpy>=1.5 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib)
Requirement already satisfied: python-dateutil in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib)
Collecting tornado (from matplotlib) Could not fetch URL https://pypi.python.org/simple/tornado/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping Could not find a version that satisfies the requirement tornado (from matplotlib) (from versions: ) No matching distribution found for tornado (from matplotlib)
I also tried :
$ sudo pip install matplotlib
but same error and python gives the error it is not installed. Help?
Basically there are 3 possible causes I can see:
conflict of python 3 or 2 versions (most liekly)
OSX-specific bugs (needs a newer pip version as discussed here),
you are behind firewal (you can disable SSL by adding flags to pip command)
To make sure you are installing to python 3 you can use:
pip3 install -U matplotlib
Vertual environments and pipenv, conda and possibly poetry are your friends to achive greater isolation of python project setups in the future.
I am using python jira package installed using PIP in a virtual environment. Recently my script started to complain about jira package version:
$ ./my_script.sh
jira/client.py:282: UserWarning: You are running an outdated version of JIRA Python 1.0.3. Current version is 1.0.6.dev20160420173258. Do not file any bugs against older versions.
I tried upgrade using pip like:
$ pip install --upgrade --no-cache-dir jira
Collecting jira
Downloading jira-1.0.3-py2.py3-none-any.whl (46kB)
100% |████████████████████████████████| 51kB 175kB/s
Requirement already up-to-date: requests>=2.6.0 in <...>/.virtualenvs/jira/lib/python3.4/site-packages (from jira)
Requirement already up-to-date: requests-oauthlib>=0.3.3 in <...>/.virtualenvs/jira/lib/python3.4/site-packages (from jira)
Requirement already up-to-date: six>=1.9.0 in <...>/.virtualenvs/jira/lib/python3.4/site-packages (from jira)
Requirement already up-to-date: requests-toolbelt in <...>/.virtualenvs/jira/lib/python3.4/site-packages (from jira)
Requirement already up-to-date: tlslite>=0.4.4 in <...>/.virtualenvs/jira/lib/python3.4/site-packages (from jira)
Requirement already up-to-date: oauthlib>=0.6.2 in <...>/.virtualenvs/jira/lib/python3.4/site-packages (from requests-oauthlib>=0.3.3->jira)
Installing collected packages: jira
Successfully installed jira-1.0.3
I tried to remove installed jira package and install it freshly with same result. Pip always installs only version 1.0.3 but scripts complain about newer version.
My assumption is that 1.0.6 is marked as released (the check is inside the package itself) but not published (I don´t know if this is the right word) for pip to download.
Any clue?
Regards,
JrBenito
It appears there is a 1.0.6.dev20160420173258 version but this isn't being downloaded when using pip install jira. It can be installed by using the workaround found on the issue #156 for this new version. pip install https://pypi.python.org/packages/f6/ea/2535e412ff76d85da20d2be6d1eaf9aa5de49481da94f2fe7e8830eedd35/jira-1.0.6.dev20160420173258-py2.py3-none-any.whl Which it appears you have already commented on, so hopefully they resolve the issue permanently.
I had this same issue, even after specifically downloading the 1.0.6.dev20160420173258 version. When the client.py file gets the version information, it doesn't get the git changeset correctly and so returns 1.0.6 instead of 1.0.6.dev20160420173258.
For now I made a workaround by hardcoding the version number pulled from https://pypi.python.org/pypi/jira/json
In /usr/lib/python2.7/site-packages/jira/client.py:
released_version = "1.0.6" # data['info']['version']
This is admittedly not a fix but lets hope it gets fixed.
It worked for me only after changed it to
/usr/lib/python2.7/site-packages/jira/client.py:
with
released_version = "1.0.6" # data['info']['version']
I'm trying to use apns-client 0.2.1 but I only get an error message.
22:56:01 $ pip install apnsclient==0.2.1
Collecting apnsclient==0.2.1
Could not find a version that satisfies the requirement apnsclient==0.2.1 (from versions: 0.1)
No matching distribution found for apnsclient==0.2.1
How can I install 0.2.1 version and then save it in requirements.txt? I need it in this way because my hosting use this file too.
The package is called apns-client, notice the dash.
pip install apns-client