Goal: install typed-json-dataclass in project venv.
Python 3.6.13
conda 4.11.0
Terminal:
(project) me#ubuntu-pcs:~/PycharmProjects/project$ pip install typed_json_dataclass
ERROR: Could not find a version that satisfies the requirement typed_json_dataclass (from versions: none)
ERROR: No matching distribution found for typed_json_dataclass
(project) me#ubuntu-pcs:~/PycharmProjects/project$ pip install typed-json-dataclass
ERROR: Could not find a version that satisfies the requirement typed-json-dataclass (from versions: none)
ERROR: No matching distribution found for typed-json-dataclass
requirements.txt:
typed_json_dataclass
typed_json_dataclass==1.2.1
typed_json_dataclass==1.2.*
Terminal:
(project) me#ubuntu-pcs:~/PycharmProjects/project$ pip install -r requirements.txt
ERROR: Could not find a version that satisfies the requirement typed_json_dataclass (from versions: none)
ERROR: No matching distribution found for typed_json_dataclass
(project) me#ubuntu-pcs:~/PycharmProjects/project$ pip install -r requirements.txt
ERROR: Could not find a version that satisfies the requirement typed_json_dataclass==1.2.1 (from versions: none)
ERROR: No matching distribution found for typed_json_dataclass==1.2.1
(project) me#ubuntu-pcs:~/PycharmProjects/project$ pip install -r requirements.txt
ERROR: Could not find a version that satisfies the requirement typed_json_dataclass==1.2.* (from versions: none)
ERROR: No matching distribution found for typed_json_dataclass==1.2.*
I can however install via. a separate project repo and venv:
Python 3.9.12
Terminal:
(project2) me#ubuntu-pcs:~/PycharmProjects/project2$ pip install typed_json_dataclass
Requirement already satisfied: typed_json_dataclass in /home/me/miniconda3/envs/project2/lib/python3.9/site-packages (1.2.1)
Requirement already satisfied: flake8-tuple<0.5.0,>=0.4.0 in /home/me/miniconda3/envs/project2/lib/python3.9/site-packages (from typed_json_dataclass) (0.4.1)
Requirement already satisfied: flake8 in /home/me/miniconda3/envs/project2/lib/python3.9/site-packages (from flake8-tuple<0.5.0,>=0.4.0->typed_json_dataclass) (4.0.1)
Requirement already satisfied: six in /home/me/miniconda3/envs/project2/lib/python3.9/site-packages (from flake8-tuple<0.5.0,>=0.4.0->typed_json_dataclass) (1.16.0)
Requirement already satisfied: pyflakes<2.5.0,>=2.4.0 in /home/me/miniconda3/envs/project2/lib/python3.9/site-packages (from flake8->flake8-tuple<0.5.0,>=0.4.0->typed_json_dataclass) (2.4.0)
Requirement already satisfied: mccabe<0.7.0,>=0.6.0 in /home/me/miniconda3/envs/project2/lib/python3.9/site-packages (from flake8->flake8-tuple<0.5.0,>=0.4.0->typed_json_dataclass) (0.6.1)
Requirement already satisfied: pycodestyle<2.9.0,>=2.8.0 in /home/me/miniconda3/envs/project2/lib/python3.9/site-packages (from flake8->flake8-tuple<0.5.0,>=0.4.0->typed_json_dataclass) (2.8.0)
See the pypi page of typed-json-dataclass under Meta:
Requires: Python >=3.7, <4.0
which is why pip cannot install it for your python 3.6
There is no way to get it to work with python 3.6, as its sole purpose is to expand the dataclass which was only added in python 3.7, so you will need to switch to a different python version (if possible)
I am on Ubuntu 21.10 and created a small python package which also consists of a setup.py and setup.cfg file. In my setup.cfg there are these lines:
[install]
install_scripts = /etc/icinga2/scripts
Now when I am in that directory and try to install virtualenv or any other package I get this:
nicolas#tp-t14:~/git/test$ pip3 install virtualenv
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Defaulting to user installation because normal site-packages is not writeable
Collecting virtualenv
Using cached virtualenv-20.14.1-py2.py3-none-any.whl (8.8 MB)
Requirement already satisfied: six<2,>=1.9.0 in /usr/lib/python3/dist-packages (from virtualenv) (1.16.0)
Requirement already satisfied: filelock<4,>=3.2 in /home/nicolas/.local/lib/python3.9/site-packages (from virtualenv) (3.7.0)
Requirement already satisfied: platformdirs<3,>=2 in /usr/local/lib/python3.9/dist-packages (from virtualenv) (2.5.1)
Requirement already satisfied: distlib<1,>=0.3.1 in /home/nicolas/.local/lib/python3.9/site-packages (from virtualenv) (0.3.4)
Installing collected packages: virtualenv
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
ERROR: Could not install packages due to an OSError: [Errno 13] Keine Berechtigung: '/etc/icinga2'
Check the permissions.
Why does pip3 reads from setup.cfg when I only want to install a package. It also happens with other packages I want to install. If I remove these lines from the setup.cfg file the installation works flawlessly and looks like this:
nicolas#tp-t14:~/git/test$ pip3 install virtualenv
Defaulting to user installation because normal site-packages is not writeable
Collecting virtualenv
Using cached virtualenv-20.14.1-py2.py3-none-any.whl (8.8 MB)
Requirement already satisfied: platformdirs<3,>=2 in /usr/local/lib/python3.9/dist-packages (from virtualenv) (2.5.1)
Requirement already satisfied: filelock<4,>=3.2 in /home/nicolas/.local/lib/python3.9/site-packages (from virtualenv) (3.7.0)
Requirement already satisfied: six<2,>=1.9.0 in /usr/lib/python3/dist-packages (from virtualenv) (1.16.0)
Requirement already satisfied: distlib<1,>=0.3.1 in /home/nicolas/.local/lib/python3.9/site-packages (from virtualenv) (0.3.4)
Installing collected packages: virtualenv
Successfully installed virtualenv-20.14.1
There are even no DEPRECATION warnings anymore.
I only want to understand the background of that because I now struggled quite a lot of time with my deployment scripts here because of that.
As the answer to this question indicates, pip in a conda-env should install a package in the site-packages directory of env's python. In my case, however, pip (launched within the env) is trying to install in the global python site-packages.
Additionally, the installation in the site-packages of my global python is not so very clean either: newly installed packages fall under /Users/massimopinto/Library/Python/3.9/site-packages/Users/massimopinto/Library/Python/3.9/site-packages , that is the directory is nested within itself, so I need to manually move the new package to make it usable.
Would a re-configuration of pip work? Any advice would be much appreciated.
pip in use (21.2.4):
(spekpy) massimopinto#MacBook-Air-2 spekpy_release % which pip
/Users/massimopinto/opt/miniconda3/envs/spekpy/bin/pip
(env's) pip configuration:
(spekpy) massimopinto#MacBook-Air-2 spekpy_release % pip config list
freeze.timeout='10'
global.editor='vim'
global.timeout='60'
home's pip configuration:
(spekpy) massimopinto#MacBook-Air-2 spekpy_release % cat ~/.pip/pip.conf
[global]
timeout = 60
[freeze]
timeout = 10
running on a MacOS Monterey 12.0.1, conda 4.10.3, Python 3.9.7.
Edited
As at a suggestion by #flyingteller, the output of
/Users/massimopinto/opt/miniconda3/envs/spekpy/bin/python -m pip install . >> spekpy-install.log
is
Processing /Users/massimopinto/Progetti Git/spekpy_release
Requirement already satisfied: scipy in /Users/massimopinto/opt/miniconda3/envs/spekpy/lib/python3.9/site-packages (from spekpy==2.0.6) (1.7.1)
Requirement already satisfied: matplotlib in /Users/massimopinto/opt/miniconda3/envs/spekpy/lib/python3.9/site-packages (from spekpy==2.0.6) (3.4.3)
Requirement already satisfied: pyparsing>=2.2.1 in /Users/massimopinto/opt/miniconda3/envs/spekpy/lib/python3.9/site-packages (from matplotlib->spekpy==2.0.6) (3.0.4)
Requirement already satisfied: numpy>=1.16 in /Users/massimopinto/opt/miniconda3/envs/spekpy/lib/python3.9/site-packages (from matplotlib->spekpy==2.0.6) (1.21.2)
Requirement already satisfied: kiwisolver>=1.0.1 in /Users/massimopinto/opt/miniconda3/envs/spekpy/lib/python3.9/site-packages (from matplotlib->spekpy==2.0.6) (1.3.1)
Requirement already satisfied: python-dateutil>=2.7 in /Users/massimopinto/opt/miniconda3/envs/spekpy/lib/python3.9/site-packages (from matplotlib->spekpy==2.0.6) (2.8.2)
Requirement already satisfied: cycler>=0.10 in /Users/massimopinto/opt/miniconda3/envs/spekpy/lib/python3.9/site-packages (from matplotlib->spekpy==2.0.6) (0.11.0)
Requirement already satisfied: pillow>=6.2.0 in /Users/massimopinto/opt/miniconda3/envs/spekpy/lib/python3.9/site-packages (from matplotlib->spekpy==2.0.6) (8.4.0)
Requirement already satisfied: six>=1.5 in /Users/massimopinto/opt/miniconda3/envs/spekpy/lib/python3.9/site-packages (from python-dateutil>=2.7->matplotlib->spekpy==2.0.6) (1.16.0)
Building wheels for collected packages: spekpy
Building wheel for spekpy (setup.py): started
Building wheel for spekpy (setup.py): finished with status 'done'
Created wheel for spekpy: filename=spekpy-2.0.6-py3-none-any.whl size=66391250 sha256=86962e10ec6182d7f0522dcf0d3e1d264b9d16d3659d5d5af038631d99bd8039
Stored in directory: /private/var/folders/qs/hcv45zhn46q0p6xwndbc51fw0000gn/T/pip-ephem-wheel-cache-etx845ts/wheels/c3/93/d0/2db997ad51d9b10f0b0acac3a1f27240cca3d41a8cac3265ab
Successfully built spekpy
Installing collected packages: spekpy
Successfully installed spekpy-2.0.6
but the installation is still in
/Users/massimopinto/Library/Python/3.9/site-packages/Users/massimopinto/Library/Python/3.9/site-packages/spekpy
I have installed rasa using the below commands on my Windows 10.
d:\Learning\vs_rasa_4_beg_udemy>python -m venv ./venv
d:\Learning\vs_rasa_4_beg_udemy>.\venv\Scripts\activate
(venv) d:\Learning\vs_rasa_4_beg_udemy>pip3 install -U --user pip
(venv) d:\Learning\vs_rasa_4_beg_udemy>python -m pip install --upgrade pip
(venv) d:\Learning\vs_rasa_4_beg_udemy>pip3 install rasa
After the above, I have run
(venv) d:\Learning\vs_rasa_4_beg_udemy>rasa init
for which I am getting the message:
'rasa' is not recognized as an internal or external command, operable
program or batch file.
I tried to rerun the pip3 install rasa, which shows that all requirements are satisfied. Why is that rasa init is not getting executed? What shall be done? Appreciate inputs.
(venv) d:\Learning\vs_rasa_4_beg_udemy>pip3 install rasa
Requirement already satisfied: rasa in d:\learning\vs_rasa_4_beg_udemy\venv\lib\site-packages (0.0.5)
Requirement already satisfied: requests in d:\learning\vs_rasa_4_beg_udemy\venv\lib\site-packages (from rasa) (2.26.0)
Requirement already satisfied: charset-normalizer~=2.0.0 in d:\learning\vs_rasa_4_beg_udemy\venv\lib\site-packages (from requests->rasa) (2.0.6)
Requirement already satisfied: certifi>=2017.4.17 in d:\learning\vs_rasa_4_beg_udemy\venv\lib\site-packages (from requests->rasa) (2021.5.30)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in d:\learning\vs_rasa_4_beg_udemy\venv\lib\site-packages (from requests->rasa) (1.26.7)
Requirement already satisfied: idna<4,>=2.5 in d:\learning\vs_rasa_4_beg_udemy\venv\lib\site-packages (from requests->rasa) (3.2)
Please check if the Python version you're using matches the rasa requirements (currently only Python 3.6, 3.7 and 3.8 are supported)
I tried to install pybel in conda, but it doesn't really work, even though the installation looks ok, all the module's API function aren't present.
me$ conda create --name py34 python=3.4
Fetching package metadata .................
Solving package specifications: .
Package plan for installation in environment /Users/me/anaconda3/envs/py34:
The following NEW packages will be INSTALLED:
ca-certificates: 2018.1.18-0 conda-forge
certifi: 2017.1.23-py34_0 conda-forge
ncurses: 5.9-10 conda-forge
openssl: 1.0.2n-0 conda-forge
pip: 9.0.1-py34_0 conda-forge
python: 3.4.5-2 conda-forge
readline: 6.2-0 conda-forge
setuptools: 32.3.1-py34_0 conda-forge
sqlite: 3.13.0-1 conda-forge
tk: 8.5.19-2 conda-forge
wheel: 0.29.0-py34_0 conda-forge
xz: 5.2.3-0 conda-forge
zlib: 1.2.11-0 conda-forge
Proceed ([y]/n)? y
#
# To activate this environment, use:
# > source activate py34
#
# To deactivate an active environment, use:
# > source deactivate
#
Activated the enviorment:
me$ source activate py34
(py34) iMac:me$ pip install pybel
Collecting pybel
Using cached PyBEL-0.11.0-py2.py3-none-any.whl
Collecting click (from pybel)
Using cached click-6.7-py2.py3-none-any.whl
Collecting pyparsing (from pybel)
Using cached pyparsing-2.2.0-py2.py3-none-any.whl
Collecting six (from pybel)
Using cached six-1.11.0-py2.py3-none-any.whl
Collecting sqlalchemy==1.1.15 (from pybel)
Collecting requests-file (from pybel)
Using cached requests_file-1.4.3-py2.py3-none-any.whl
Collecting requests (from pybel)
Using cached requests-2.18.4-py2.py3-none-any.whl
Collecting networkx==1.11 (from pybel)
Using cached networkx-1.11-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests->pybel)
Using cached certifi-2018.1.18-py2.py3-none-any.whl
Collecting idna<2.7,>=2.5 (from requests->pybel)
Using cached idna-2.6-py2.py3-none-any.whl
Collecting urllib3<1.23,>=1.21.1 (from requests->pybel)
Using cached urllib3-1.22-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests->pybel)
Using cached chardet-3.0.4-py2.py3-none-any.whl
Collecting decorator>=3.4.0 (from networkx==1.11->pybel)
Using cached decorator-4.2.1-py2.py3-none-any.whl
Installing collected packages: click, pyparsing, six, sqlalchemy, certifi, idna, urllib3, chardet, requests, requests-file, decorator, networkx, pybel
Found existing installation: certifi 2017.1.23
DEPRECATION: Uninstalling a distutils installed project (certifi) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling certifi-2017.1.23:
Successfully uninstalled certifi-2017.1.23
Successfully installed certifi-2018.1.18 chardet-3.0.4 click-6.7 decorator-4.2.1 idna-2.6 networkx-1.11 pybel-0.11.0 pyparsing-2.2.0 requests-2.18.4 requests-file-1.4.3 six-1.11.0 sqlalchemy-1.1.15 urllib3-1.22
(py34) iMac: me$ pip install pybel
Requirement already satisfied: pybel in /Users/me/anaconda3/envs/py34/lib/python3.4/site-packages
Requirement already satisfied: sqlalchemy==1.1.15 in /Users/me/anaconda3/envs/py34/lib/python3.4/site-packages (from pybel)
Requirement already satisfied: click in /Users/me/anaconda3/envs/py34/lib/python3.4/site-packages (from pybel)
Requirement already satisfied: requests in /Users/me/anaconda3/envs/py34/lib/python3.4/site-packages (from pybel)
Requirement already satisfied: six in /Users/me/anaconda3/envs/py34/lib/python3.4/site-packages (from pybel)
Requirement already satisfied: networkx==1.11 in /Users/me/anaconda3/envs/py34/lib/python3.4/site-packages (from pybel)
Requirement already satisfied: requests-file in /Users/me/anaconda3/envs/py34/lib/python3.4/site-packages (from pybel)
Requirement already satisfied: pyparsing in /Users/me/anaconda3/envs/py34/lib/python3.4/site-packages (from pybel)
Requirement already satisfied: idna<2.7,>=2.5 in /Users/me/anaconda3/envs/py34/lib/python3.4/site-packages (from requests->pybel)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Users/me/anaconda3/envs/py34/lib/python3.4/site-packages (from requests->pybel)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /Users/me/anaconda3/envs/py34/lib/python3.4/site-packages (from requests->pybel)
Requirement already satisfied: certifi>=2017.4.17 in /Users/me/anaconda3/envs/py34/lib/python3.4/site-packages (from requests->pybel)
Requirement already satisfied: decorator>=3.4.0 in /Users/me/anaconda3/envs/py34/lib/python3.4/site-packages (from networkx==1.11->pybel)
Ran python prompt and tried to import pybel but it doesn't really have the API inside (for example readfile):
(py34) iMac: me$ python
Python 3.4.5 | packaged by conda-forge | (default, Sep 8 2016, 14:36:28)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.54)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pybel
>>> dir(pybel)
['BELGraph', 'Manager', 'NDEX_SOURCE_FORMAT', 'NetworkManager', '__all__', '__author__', '__builtins__', '__cached__', '__copyright__', '__description__', '__doc__', '__email__', '__file__', '__license__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__title__', '__url__', '__version__', 'and_edge_predicates', 'build_annotation_dict_all_filter', 'build_annotation_dict_any_filter', 'cache_manager', 'canonicalize', 'concatenate_node_predicates', 'constants', 'count_functions', 'count_namespaces', 'count_passed_edge_filter', 'count_passed_node_filter', 'database_io', 'dsl', 'edge_has_activity', 'edge_has_annotation', 'edge_has_degradation', 'edge_has_translocation', 'edge_predicate', 'edge_to_bel', 'egf_graph', 'examples', 'exceptions', 'filter_edges', 'filter_nodes', 'from_biopax', 'from_bytes', 'from_cbn_jgif', 'from_cx', 'from_cx_file', 'from_cx_jsons', 'from_database', 'from_indra_pickle', 'from_indra_statements', 'from_jgif', 'from_json', 'from_json_file', 'from_jsons', 'from_lines', 'from_ndex', 'from_path', 'from_pickle', 'from_url', 'from_web', 'get_annotation_values_by_annotation', 'get_functions', 'get_names_by_namespace', 'get_namespaces', 'get_nodes', 'get_pubmed_identifiers', 'get_syntax_errors', 'get_unused_namespaces', 'has_activity', 'has_authors', 'has_causal_in_edges', 'has_causal_out_edges', 'has_fragment', 'has_gene_modification', 'has_hgvs', 'has_polarity', 'has_protein_modification', 'has_provenance', 'has_pubmed', 'has_variant', 'invert_edge_filter', 'io', 'is_abundance', 'is_associative_relation', 'is_causal_central', 'is_causal_relation', 'is_causal_sink', 'is_causal_source', 'is_degraded', 'is_direct_causal_relation', 'is_gene', 'is_pathology', 'is_protein', 'is_translocated', 'iter_annotation_value_pairs', 'iter_annotation_values', 'iterate_pubmed_identifiers', 'keep_node_permissive', 'language', 'left_full_join', 'left_node_intersection_join', 'left_outer_join', 'manager', 'node_exclusion_predicate_builder', 'node_inclusion_predicate_builder', 'node_intersection', 'node_to_bel', 'not_pathology', 'parser', 'resources', 'sialic_acid_graph', 'strip_annotations', 'struct', 'to_bel', 'to_bel_lines', 'to_bel_path', 'to_bytes', 'to_csv', 'to_cx', 'to_cx_file', 'to_cx_jsons', 'to_database', 'to_graphml', 'to_gsea', 'to_indra', 'to_jgif', 'to_json', 'to_json_file', 'to_jsons', 'to_ndex', 'to_neo4j', 'to_pickle', 'to_sif', 'to_web', 'tokens', 'union', 'utils']
>>> pybel.readfile("pdb","a.pdb")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'readfile'
>>>
If you are using Windows, you may use the below command:
python -m pip install pybel_tools
If you are using Linux:
sudo python3 -m pip install pybel_tools