How can I downgrade packaging when installing scanpy? - python

When trying to install scanpy, I get the following error
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
poetry 1.1.11 requires packaging<21.0,>=20.4, but you have packaging 21.2 which is incompatible
In that sense, I tried to downgrade packaging from version 21.2 to 20.9 or 20.8, with
! pip install --upgrade packaging==20.9
or with
! pip uninstall packaging -y
! pip install -I packaging==20.8
but I still get that error, as if the packaging version did not change.
Here is the full block
! pip install --upgrade packaging==20.9
#! pip uninstall packaging -y
#! pip install -I packaging==20.8
#! pip install poetry --upgrade
! pip uninstall scanpy -y
! pip install -I scanpy
and the full output
Collecting packaging==20.9
Using cached packaging-20.9-py2.py3-none-any.whl (40 kB)
Requirement already satisfied: pyparsing>=2.0.2 in /data04/projects04/MarianaBoroni/lbbc_members/lib/conda_envs/diogoamb/lib/python3.9/site-packages (from packaging==20.9) (3.0.4)
Installing collected packages: packaging
Attempting uninstall: packaging
Found existing installation: packaging 21.2
Uninstalling packaging-21.2:
Successfully uninstalled packaging-21.2
Successfully installed packaging-20.9
Found existing installation: scanpy 1.8.2
Uninstalling scanpy-1.8.2:
Successfully uninstalled scanpy-1.8.2
Collecting scanpy
Using cached scanpy-1.8.2-py3-none-any.whl (2.0 MB)
Collecting anndata>=0.7.4
Using cached anndata-0.7.6-py3-none-any.whl (127 kB)
Collecting h5py>=2.10.0
Using cached h5py-3.5.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (4.5 MB)
Collecting scipy>=1.4
Using cached scipy-1.7.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (28.5 MB)
Collecting sinfo
Using cached sinfo-0.3.4-py3-none-any.whl
Collecting matplotlib>=3.1.2
Using cached matplotlib-3.4.3-cp39-cp39-manylinux1_x86_64.whl (10.3 MB)
Collecting umap-learn>=0.3.10
Using cached umap_learn-0.5.2-py3-none-any.whl
Collecting numba>=0.41.0
Using cached numba-0.54.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.3 MB)
Collecting joblib
Using cached joblib-1.1.0-py2.py3-none-any.whl (306 kB)
Collecting numpy>=1.17.0
Using cached numpy-1.21.4-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.7 MB)
Collecting seaborn
Using cached seaborn-0.11.2-py3-none-any.whl (292 kB)
Collecting natsort
Using cached natsort-8.0.0-py3-none-any.whl (37 kB)
Collecting statsmodels>=0.10.0rc2
Using cached statsmodels-0.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.9 MB)
Collecting networkx>=2.3
Using cached networkx-2.6.3-py3-none-any.whl (1.9 MB)
Collecting tables
Using cached tables-3.6.1-cp39-cp39-manylinux2010_x86_64.whl (14.3 MB)
Collecting tqdm
Using cached tqdm-4.62.3-py2.py3-none-any.whl (76 kB)
Collecting patsy
Using cached patsy-0.5.2-py2.py3-none-any.whl (233 kB)
Collecting scikit-learn>=0.22
Using cached scikit_learn-1.0.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (24.7 MB)
Collecting packaging
Using cached packaging-21.2-py3-none-any.whl (40 kB)
Collecting pandas>=0.21
Using cached pandas-1.3.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.5 MB)
Collecting xlrd<2.0
Using cached xlrd-1.2.0-py2.py3-none-any.whl (103 kB)
Collecting kiwisolver>=1.0.1
Using cached kiwisolver-1.3.2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.6 MB)
Collecting cycler>=0.10
Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting pyparsing>=2.2.1
Using cached pyparsing-3.0.4-py3-none-any.whl (96 kB)
Collecting python-dateutil>=2.7
Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting pillow>=6.2.0
Using cached Pillow-8.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB)
Collecting llvmlite<0.38,>=0.37.0rc1
Using cached llvmlite-0.37.0-cp39-cp39-manylinux2014_x86_64.whl (26.3 MB)
Collecting numpy>=1.17.0
Using cached numpy-1.20.3-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.4 MB)
Collecting setuptools
Using cached setuptools-58.5.3-py3-none-any.whl (946 kB)
Collecting pyparsing>=2.2.1
Using cached pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
Collecting pytz>=2017.3
Using cached pytz-2021.3-py2.py3-none-any.whl (503 kB)
Collecting six>=1.5
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting threadpoolctl>=2.0.0
Using cached threadpoolctl-3.0.0-py3-none-any.whl (14 kB)
Collecting pynndescent>=0.5
Using cached pynndescent-0.5.5-py3-none-any.whl
Collecting stdlib-list
Using cached stdlib_list-0.8.0-py3-none-any.whl (63 kB)
Collecting numexpr>=2.6.2
Using cached numexpr-2.7.3-cp39-cp39-manylinux2010_x86_64.whl (471 kB)
Installing collected packages: numpy, threadpoolctl, six, setuptools, scipy, llvmlite, joblib, scikit-learn, pytz, python-dateutil, pyparsing, pillow, numba, kiwisolver, cycler, xlrd, tqdm, stdlib-list, pynndescent, patsy, pandas, packaging, numexpr, natsort, matplotlib, h5py, umap-learn, tables, statsmodels, sinfo, seaborn, networkx, anndata, scanpy
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
poetry 1.1.11 requires packaging<21.0,>=20.4, but you have packaging 21.2 which is incompatible.
Successfully installed anndata-0.7.6 cycler-0.11.0 h5py-3.5.0 joblib-1.1.0 kiwisolver-1.3.2 llvmlite-0.37.0 matplotlib-3.4.3 natsort-8.0.0 networkx-2.6.3 numba-0.54.1 numexpr-2.7.3 numpy-1.21.1 packaging-21.2 pandas-1.3.4 patsy-0.5.2 pillow-8.4.0 pynndescent-0.5.5 pyparsing-3.0.4 python-dateutil-2.8.2 pytz-2021.3 scanpy-1.8.2 scikit-learn-1.0.1 scipy-1.7.1 seaborn-0.11.2 setuptools-58.5.3 sinfo-0.3.4 six-1.16.0 statsmodels-0.13.0 stdlib-list-0.8.0 tables-3.6.1 threadpoolctl-3.0.0 tqdm-4.62.3 umap-learn-0.5.2 xlrd-1.2.0

You could try installing all your packages in one line like this and see if the conflicts are resolved, pip install packaging scanpy. You could also try with your specific versions like this pip install packaging==20.9 scanpy==1.0 or whatever version you like. You can also try installing like this pip install package>=20.9 package2<1.9
You could also try using a package manager like conda or mamba, create a new environment and try installing the packages there. The package managers try to resolve conflicts like that.

Related

Error to install Jupyter Notebook for Python in Windows 10 using PIP

i am very on amateur on these things. I downloaded pip and then i used this python get-pip.py to install pip which completed successfully and then i used pip install jupyter notebook and i got the below error
error: subprocess-exited-with-error
Any help will ve appreciated
Microsoft Windows [Version 10.0.19043.2130]
(c) Microsoft Corporation. All rights reserved.
C:\Users\antonis>cd Desktop
C:\Users\antonis\Desktop>python get-pip.py
Defaulting to user installation because normal site-packages is not writeable
Collecting pip
Using cached pip-22.3-py3-none-any.whl (2.1 MB)
Collecting wheel
Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel, pip
WARNING: The script wheel.exe is installed in 'C:\Users\antonis\AppData\Roaming\Python\Python311\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Attempting uninstall: pip
Found existing installation: pip 22.3
Uninstalling pip-22.3:
Successfully uninstalled pip-22.3
WARNING: The scripts pip.exe, pip3.10.exe, pip3.11.exe and pip3.exe are installed in 'C:\Users\antonis\AppData\Roaming\Python\Python311\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-22.3 wheel-0.37.1
C:\Users\antonis\Desktop>pip install jupyter notebook
Defaulting to user installation because normal site-packages is not writeable
Collecting jupyter
Using cached jupyter-1.0.0-py2.py3-none-any.whl (2.7 kB)
Collecting notebook
Using cached notebook-6.5.1-py3-none-any.whl (439 kB)
Collecting qtconsole
Using cached qtconsole-5.3.2-py3-none-any.whl (120 kB)
Collecting jupyter-console
Using cached jupyter_console-6.4.4-py3-none-any.whl (22 kB)
Collecting nbconvert
Using cached nbconvert-7.2.2-py3-none-any.whl (271 kB)
Collecting ipykernel
Using cached ipykernel-6.16.1-py3-none-any.whl (138 kB)
Collecting ipywidgets
Using cached ipywidgets-8.0.2-py3-none-any.whl (134 kB)
Collecting jinja2
Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting tornado>=6.1
Using cached tornado-6.2-cp37-abi3-win_amd64.whl (425 kB)
Collecting pyzmq>=17
Using cached pyzmq-24.0.1-cp311-cp311-win_amd64.whl (990 kB)
Collecting argon2-cffi
Using cached argon2_cffi-21.3.0-py3-none-any.whl (14 kB)
Collecting traitlets>=4.2.1
Using cached traitlets-5.5.0-py3-none-any.whl (107 kB)
Collecting jupyter-core>=4.6.1
Using cached jupyter_core-4.11.2-py3-none-any.whl (88 kB)
Collecting jupyter-client>=5.3.4
Using cached jupyter_client-7.4.3-py3-none-any.whl (132 kB)
Collecting ipython-genutils
Using cached ipython_genutils-0.2.0-py2.py3-none-any.whl (26 kB)
Collecting nbformat
Using cached nbformat-5.7.0-py3-none-any.whl (77 kB)
Collecting nest-asyncio>=1.5
Using cached nest_asyncio-1.5.6-py3-none-any.whl (5.2 kB)
Collecting Send2Trash>=1.8.0
Using cached Send2Trash-1.8.0-py3-none-any.whl (18 kB)
Collecting terminado>=0.8.3
Using cached terminado-0.16.0-py3-none-any.whl (16 kB)
Collecting prometheus-client
Using cached prometheus_client-0.15.0-py3-none-any.whl (60 kB)
Collecting nbclassic==0.4.5
Using cached nbclassic-0.4.5-py3-none-any.whl (9.8 MB)
Collecting jupyter-server>=1.8
Using cached jupyter_server-1.21.0-py3-none-any.whl (346 kB)
Collecting notebook-shim>=0.1.0
Using cached notebook_shim-0.2.0-py3-none-any.whl (13 kB)
Collecting entrypoints
Using cached entrypoints-0.4-py3-none-any.whl (5.3 kB)
Requirement already satisfied: python-dateutil>=2.8.2 in c:\users\antonis\appdata\roaming\python\python311\site-packages (from jupyter-client>=5.3.4->notebook) (2.8.2)
Collecting pywin32>=1.0
Using cached pywin32-304-cp311-cp311-win_amd64.whl (12.1 MB)
Collecting beautifulsoup4
Using cached beautifulsoup4-4.11.1-py3-none-any.whl (128 kB)
Collecting bleach
Using cached bleach-5.0.1-py3-none-any.whl (160 kB)
Collecting defusedxml
Using cached defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Collecting jupyterlab-pygments
Using cached jupyterlab_pygments-0.2.2-py2.py3-none-any.whl (21 kB)
Collecting markupsafe>=2.0
Using cached MarkupSafe-2.1.1.tar.gz (18 kB)
Preparing metadata (setup.py) ... done
Collecting mistune<3,>=2.0.3
Using cached mistune-2.0.4-py2.py3-none-any.whl (24 kB)
Collecting nbclient>=0.5.0
Using cached nbclient-0.7.0-py3-none-any.whl (71 kB)
Requirement already satisfied: packaging in c:\users\antonis\appdata\roaming\python\python311\site-packages (from nbconvert->jupyter) (21.3)
Collecting pandocfilters>=1.4.1
Using cached pandocfilters-1.5.0-py2.py3-none-any.whl (8.7 kB)
Collecting pygments>=2.4.1
Using cached Pygments-2.13.0-py3-none-any.whl (1.1 MB)
Collecting tinycss2
Using cached tinycss2-1.2.1-py3-none-any.whl (21 kB)
Collecting fastjsonschema
Using cached fastjsonschema-2.16.2-py3-none-any.whl (22 kB)
Collecting jsonschema>=2.6
Using cached jsonschema-4.16.0-py3-none-any.whl (83 kB)
Collecting pywinpty>=1.1.0
Using cached pywinpty-2.0.8.tar.gz (23 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Cargo, the Rust package manager, is not installed or is not on PATH.
This package requires Rust and Cargo to compile extensions. Install it through
the system's package manager or via https://rustup.rs/
Checking for Rust toolchain....
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
This problem is usually related to your python version, you can try to delete python 3.10 and install 3.9

Python annotation - why does my IDE's Intellisense not recognise a known class?

I am using client library google-cloud-pubsub in order to to interact with Google Cloud Platform's Pub/Sub service. There is a class in that library called google.cloud.pubsub_v1.types.Subscription, documentation for which appears at https://googleapis.dev/python/pubsub/latest/types.html.
I am using this library successfully an am able to interact with a Pub/Sub subscription using something like the following:
from google.cloud import pubsub_v1
def myfunc(project_id, subscription):
subscriber = pubsub_v1.SubscriberClient()
subscription_path = subscriber.subscription_path(project_id, subscription.name)
# do something using the subscription...
I'm now trying to be a good python citizen and use type annotations in my code. I know that the value passed to the subscription argument will be of type google.cloud.pubsub_v1.types.Subscription so I'd like to write the appropriate type annotation, but I'm getting a bit confused about the behaviour that I am seeing. My editor's (my editor is VSCode) intellisense understands about pubsub_v1.types module:
However it doesn't seem to know about the Subscription class therein:
Same on PyCharm, it knows about google.cloud.pubsub_v1.types:
but not google.cloud.pubsub_v1.types.Subscription
I am struggling to understand why this might be so am hoping someone can explain it to me.
In case it helps, here's how i set up a virtualenv for this:
➜ /tmp python3 -m venv venv
➜ /tmp source venv/bin/activate
(venv) ➜ /tmp python -m pip install google-cloud-pubsub
Collecting google-cloud-pubsub
Downloading google_cloud_pubsub-2.7.0-py2.py3-none-any.whl (217 kB)
|████████████████████████████████| 217 kB 1.6 MB/s
Collecting grpcio<2.0dev,>=1.38.1
Using cached grpcio-1.39.0-cp39-cp39-macosx_10_10_x86_64.whl (3.9 MB)
Collecting grpc-google-iam-v1<0.13dev,>=0.12.3
Using cached grpc-google-iam-v1-0.12.3.tar.gz (13 kB)
Collecting libcst>=0.3.10
Downloading libcst-0.3.20-py3-none-any.whl (514 kB)
|████████████████████████████████| 514 kB 2.5 MB/s
Collecting proto-plus>=1.7.1
Using cached proto_plus-1.19.0-py3-none-any.whl (42 kB)
Collecting packaging>=14.3
Using cached packaging-21.0-py3-none-any.whl (40 kB)
Collecting google-api-core[grpc]<3.0.0dev,>=1.26.0
Downloading google_api_core-1.31.1-py2.py3-none-any.whl (93 kB)
|████████████████████████████████| 93 kB 2.8 MB/s
Collecting googleapis-common-protos<2.0dev,>=1.6.0
Using cached googleapis_common_protos-1.53.0-py2.py3-none-any.whl (198 kB)
Collecting google-auth<2.0dev,>=1.25.0
Downloading google_auth-1.34.0-py2.py3-none-any.whl (152 kB)
|████████████████████████████████| 152 kB 1.9 MB/s
Requirement already satisfied: setuptools>=40.3.0 in ./venv/lib/python3.9/site-packages (from google-api-core[grpc]<3.0.0dev,>=1.26.0->google-cloud-pubsub) (54.1.2)
Collecting pytz
Using cached pytz-2021.1-py2.py3-none-any.whl (510 kB)
Collecting protobuf>=3.12.0
Using cached protobuf-3.17.3-cp39-cp39-macosx_10_9_x86_64.whl (1.0 MB)
Collecting requests<3.0.0dev,>=2.18.0
Using cached requests-2.26.0-py2.py3-none-any.whl (62 kB)
Collecting six>=1.13.0
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting cachetools<5.0,>=2.0.0
Using cached cachetools-4.2.2-py3-none-any.whl (11 kB)
Collecting rsa<5,>=3.1.4
Using cached rsa-4.7.2-py3-none-any.whl (34 kB)
Collecting pyasn1-modules>=0.2.1
Using cached pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
Collecting pyyaml>=5.2
Using cached PyYAML-5.4.1-cp39-cp39-macosx_10_9_x86_64.whl (259 kB)
Collecting typing-extensions>=3.7.4.2
Using cached typing_extensions-3.10.0.0-py3-none-any.whl (26 kB)
Collecting typing-inspect>=0.4.0
Using cached typing_inspect-0.7.1-py3-none-any.whl (8.4 kB)
Collecting pyparsing>=2.0.2
Using cached pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
Collecting pyasn1<0.5.0,>=0.4.6
Using cached pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
Collecting idna<4,>=2.5
Using cached idna-3.2-py3-none-any.whl (59 kB)
Collecting certifi>=2017.4.17
Using cached certifi-2021.5.30-py2.py3-none-any.whl (145 kB)
Collecting charset-normalizer~=2.0.0
Downloading charset_normalizer-2.0.4-py3-none-any.whl (36 kB)
Collecting urllib3<1.27,>=1.21.1
Using cached urllib3-1.26.6-py2.py3-none-any.whl (138 kB)
Collecting mypy-extensions>=0.3.0
Using cached mypy_extensions-0.4.3-py2.py3-none-any.whl (4.5 kB)
Using legacy 'setup.py install' for grpc-google-iam-v1, since package 'wheel' is not installed.
Installing collected packages: six, pyasn1, urllib3, rsa, pyparsing, pyasn1-modules, protobuf, idna, charset-normalizer, certifi, cachetools, typing-extensions, requests, pytz, packaging, mypy-extensions, grpcio, googleapis-common-protos, google-auth, typing-inspect, pyyaml, google-api-core, proto-plus, libcst, grpc-google-iam-v1, google-cloud-pubsub
Running setup.py install for grpc-google-iam-v1 ... done
Successfully installed cachetools-4.2.2 certifi-2021.5.30 charset-normalizer-2.0.4 google-api-core-1.31.1 google-auth-1.34.0 google-cloud-pubsub-2.7.0 googleapis-common-protos-1.53.0 grpc-google-iam-v1-0.12.3 grpcio-1.39.0 idna-3.2 libcst-0.3.20 mypy-extensions-0.4.3 packaging-21.0 proto-plus-1.19.0 protobuf-3.17.3 pyasn1-0.4.8 pyasn1-modules-0.2.8 pyparsing-2.4.7 pytz-2021.1 pyyaml-5.4.1 requests-2.26.0 rsa-4.7.2 six-1.16.0 typing-extensions-3.10.0.0 typing-inspect-0.7.1 urllib3-1.26.6
WARNING: You are using pip version 21.0.1; however, version 21.2.4 is available.
You should consider upgrading via the '/private/tmp/venv/bin/python -m pip install --upgrade pip' command.

Deep animator wont install correctly

I've gotten a problem when I tried to install a piece of software called "Deep animator".
When I tried to install it (pip install deep_animator). I can't use the deep_animator tool because torch can't install. This was the result of it.
Collecting deep_animator
Using cached deep_animator-0.1.1-py3-none-any.whl (22 kB)
Collecting Pillow==5.2.0
Using cached Pillow-5.2.0-cp36-cp36m-win_amd64.whl (1.6 MB)
Collecting scipy==1.1.0
Using cached scipy-1.1.0-cp36-none-win_amd64.whl (31.1 MB)
Collecting torchvision>=0.2.1
Using cached torchvision-0.5.0-cp36-cp36m-win_amd64.whl (1.2 MB)
ERROR: Could not find a version that satisfies the requirement torch>=1.3.0 (from deep_animator) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
ERROR: No matching distribution found for torch>=1.3.0 (from deep_animator)```

Why 'sudo pip install' if 'pip install' works? (Issues with HelloAnalytics.py)

Google provides a sample HelloAnalytics.py to demonstrate the use of google-api-python-client.
Below the heading "2. Install the client library" they write:
Use pip, the recommended tool for installing Python packages:
sudo pip install --upgrade google-api-python-client
I wonder why I should use sudo while a simple pip (without sudo) seems to work perfectly (on my Mac):
% pip install google-api-python-client
Collecting google-api-python-client
Using cached google_api_python_client-1.9.3-py3-none-any.whl (59 kB)
Collecting six<2dev,>=1.6.1
Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting google-auth-httplib2>=0.0.3
Using cached google_auth_httplib2-0.0.3-py2.py3-none-any.whl (6.3 kB)
Collecting google-api-core<2dev,>=1.18.0
Using cached google_api_core-1.20.1-py2.py3-none-any.whl (90 kB)
Collecting uritemplate<4dev,>=3.0.0
Using cached uritemplate-3.0.1-py2.py3-none-any.whl (15 kB)
Collecting httplib2<1dev,>=0.9.2
Using cached httplib2-0.18.1-py3-none-any.whl (95 kB)
Collecting google-auth>=1.16.0
Using cached google_auth-1.17.2-py2.py3-none-any.whl (90 kB)
Collecting protobuf>=3.12.0
Using cached protobuf-3.12.2-cp37-cp37m-macosx_10_9_x86_64.whl (1.3 MB)
Collecting pytz
Using cached pytz-2020.1-py2.py3-none-any.whl (510 kB)
Collecting requests<3.0.0dev,>=2.18.0
Using cached requests-2.23.0-py2.py3-none-any.whl (58 kB)
Requirement already satisfied: setuptools>=34.0.0 in ./venv/lib/python3.7/site-packages (from google-api-core<2dev,>=1.18.0->google-api-python-client) (41.2.0)
Collecting googleapis-common-protos<2.0dev,>=1.6.0
Using cached googleapis_common_protos-1.52.0-py2.py3-none-any.whl (100 kB)
Collecting cachetools<5.0,>=2.0.0
Using cached cachetools-4.1.0-py3-none-any.whl (10 kB)
Collecting pyasn1-modules>=0.2.1
Using cached pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
Collecting rsa<5,>=3.1.4; python_version >= "3"
Using cached rsa-4.6-py3-none-any.whl (47 kB)
Collecting certifi>=2017.4.17
Using cached certifi-2020.4.5.2-py2.py3-none-any.whl (157 kB)
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
Using cached urllib3-1.25.9-py2.py3-none-any.whl (126 kB)
Collecting chardet<4,>=3.0.2
Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting idna<3,>=2.5
Using cached idna-2.9-py2.py3-none-any.whl (58 kB)
Collecting pyasn1<0.5.0,>=0.4.6
Using cached pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
Installing collected packages: six, cachetools, pyasn1, pyasn1-modules, rsa, google-auth, httplib2, google-auth-httplib2, protobuf, pytz, certifi, urllib3, chardet, idna, requests, googleapis-common-protos, google-api-core, uritemplate, google-api-python-client
Successfully installed cachetools-4.1.0 certifi-2020.4.5.2 chardet-3.0.4 google-api-core-1.20.1 google-api-python-client-1.9.3 google-auth-1.17.2 google-auth-httplib2-0.0.3 googleapis-common-protos-1.52.0 httplib2-0.18.1 idna-2.9 protobuf-3.12.2 pyasn1-0.4.8 pyasn1-modules-0.2.8 pytz-2020.1 requests-2.23.0 rsa-4.6 six-1.15.0 uritemplate-3.0.1 urllib3-1.25.9
Is that sample simply outdated? (They use print without () though Python 2.7 seems to be deprecated for google-api-python-client which confused others already.)
I fixed that and still get an ModuleNotFoundError: No module named 'oauth2client'. Am I right that the missing sudo is not the cause for that?
Well, and they do not explain what a VIEW_ID is and where to get this.
It works without sudo for you because you seem to have python installed in a location where your user has write permissions.
Requirement already satisfied: setuptools>=34.0.0 in ./venv/lib/python3.7/site-packages (from google-api-core<2dev,>=1.18.0->google-api-python-client) (41.2.0)
It all depends on how and where you install python. The mac os distro python is installed in /Library/ which is owned by root. So if you want to install a new package, you will need to use sudo.

Python pip doesn't build dependencies during installation

Pip doesn't seem to build dependencies from source on my Ubuntu server, while it always does that on my OS X machine. For example, when I try to install package qiime in a conda or virtualenv (I tried both) environment it takes seconds to install a hell lot of things that take loads of time to compile on my Mac.
(qiime)user#server:~$ pip install qiime
Collecting qiime
Collecting qiime-default-reference<0.2.0,>=0.1.2 (from qiime)
Collecting burrito<1.0.0,>=0.9.1 (from qiime)
Collecting pandas>=0.13.1 (from qiime)
Collecting natsort<4.0.0 (from qiime)
Using cached natsort-3.5.6-py2.py3-none-any.whl
Collecting matplotlib!=1.4.2,>=1.1.0 (from qiime)
Collecting numpy>=1.9.0 (from qiime)
Collecting gdata (from qiime)
Collecting scikit-bio<0.3.0,>=0.2.3 (from qiime)
Collecting pynast==1.2.2 (from qiime)
Collecting biom-format<2.2.0,>=2.1.4 (from qiime)
Collecting burrito-fillings<0.2.0,>=0.1.1 (from qiime)
Collecting qcli<0.2.0,>=0.1.1 (from qiime)
Collecting scipy>=0.14.0 (from qiime)
Collecting cogent==1.5.3 (from qiime)
Collecting emperor<1.0.0,>=0.9.51 (from qiime)
Collecting six (from qiime-default-reference<0.2.0,>=0.1.2->qiime)
Using cached six-1.10.0-py2.py3-none-any.whl
Collecting future (from burrito<1.0.0,>=0.9.1->qiime)
Collecting pytz>=2011k (from pandas>=0.13.1->qiime)
Using cached pytz-2015.7-py2.py3-none-any.whl
Collecting python-dateutil (from pandas>=0.13.1->qiime)
Using cached python_dateutil-2.4.2-py2.py3-none-any.whl
Collecting cycler (from matplotlib!=1.4.2,>=1.1.0->qiime)
Using cached cycler-0.9.0-py2.py3-none-any.whl
Collecting pyparsing!=2.0.0,!=2.0.4,>=1.5.6 (from matplotlib!=1.4.2,>=1.1.0->qiime)
Using cached pyparsing-2.0.6-py2.py3-none-any.whl
Collecting IPython (from scikit-bio<0.3.0,>=0.2.3->qiime)
Using cached ipython-4.0.0-py2-none-any.whl
Collecting click (from biom-format<2.2.0,>=2.1.4->qiime)
Using cached click-5.1-py2.py3-none-any.whl
Collecting pyqi (from biom-format<2.2.0,>=2.1.4->qiime)
Collecting decorator (from IPython->scikit-bio<0.3.0,>=0.2.3->qiime)
Using cached decorator-4.0.4-py2.py3-none-any.whl
Collecting simplegeneric>0.8 (from IPython->scikit-bio<0.3.0,>=0.2.3->qiime)
Collecting pexpect (from IPython->scikit-bio<0.3.0,>=0.2.3->qiime)
Collecting traitlets (from IPython->scikit-bio<0.3.0,>=0.2.3->qiime)
Using cached traitlets-4.0.0-py2.py3-none-any.whl
Collecting pickleshare (from IPython->scikit-bio<0.3.0,>=0.2.3->qiime)
Collecting ptyprocess>=0.5 (from pexpect->IPython->scikit-bio<0.3.0,>=0.2.3->qiime)
Collecting ipython-genutils (from traitlets->IPython->scikit-bio<0.3.0,>=0.2.3->qiime)
Using cached ipython_genutils-0.1.0-py2.py3-none-any.whl
Collecting path.py (from pickleshare->IPython->scikit-bio<0.3.0,>=0.2.3->qiime)
Using cached path.py-8.1.2-py2.py3-none-any.whl
Installing collected packages: six, qiime-default-reference, future, burrito, pytz, python-dateutil, numpy, pandas, natsort, cycler, pyparsing, matplotlib, gdata, scipy, decorator, simplegeneric, ptyprocess, pexpect, ipython-genutils, traitlets, path.py, pickleshare, IPython, scikit-bio, cogent, pynast, click, pyqi, biom-format, burrito-fillings, qcli, emperor, qiime
Successfully installed IPython-4.0.0 biom-format-2.1.5 burrito-0.9.1 burrito-fillings-0.1.1 click-5.1 cogent-1.5.3 cycler-0.9.0 decorator-4.0.4 emperor-0.9.51 future-0.15.2 gdata-2.0.18 ipython-genutils-0.1.0 matplotlib-1.5.0 natsort-3.5.6 numpy-1.10.1 pandas-0.17.0 path.py-8.1.2 pexpect-4.0.1 pickleshare-0.5 ptyprocess-0.5 pynast-1.2.2 pyparsing-2.0.6 pyqi-0.3.2 python-dateutil-2.4.2 pytz-2015.7 qcli-0.1.1 qiime-1.9.1 qiime-default-reference-0.1.3 scikit-bio-0.2.3 scipy-0.16.1 simplegeneric-0.8.1 six-1.10.0 traitlets-4.0.0
When I try to use the package I get various errors that prove that pip hasn't really compiled any dependencies. What should I do with that? For example, let's try to import pandas
In [1]: import pandas
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-d6ac987968b6> in <module>()
----> 1 import pandas
/home/user/.conda/envs/qiime/lib/python2.7/site-packages/pandas/__init__.py in <module>()
11 "pandas from the source directory, you may need to run "
12 "'python setup.py build_ext --inplace' to build the C "
---> 13 "extensions first.".format(module))
14
15 from datetime import datetime
ImportError: C extension: /home/user/.conda/envs/qiime/lib/python2.7/site-packages/pandas/hashtable.so: undefined symbol: PyFPE_jbuf not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C extensions first.
I know I can build everything manually, but I really want to fix pip.
Passing --no-cache-dir to pip during installation seems to solve the issue, though I don't understand what caches have to do with compilation.

Categories