I'm trying to get to grips with working inside a virtual environment, I ran the following:
python3 -m venv env
source env/bin/activate
pip3 install flask
And it throws this error:
Requirement already satisfied: flask in /usr/local/lib/python3.7/site-packages (1.1.1)
Requirement already satisfied: Werkzeug>=0.15 in /usr/local/lib/python3.7/site-packages (from flask) (1.0.1)
Requirement already satisfied: Jinja2>=2.10.1 in /usr/local/lib/python3.7/site-packages (from flask) (2.11.1)
Requirement already satisfied: click>=5.1 in /usr/local/lib/python3.7/site-packages (from flask) (7.1.1)
Requirement already satisfied: itsdangerous>=0.24 in /usr/local/lib/python3.7/site-packages (from flask) (1.1.0)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.7/site-packages (from Jinja2>=2.10.1->flask) (1.1.1)
I'm on OSX and I actually have Python 3.8 installed. I'm a bit lost on this.
I remember way back, around a year ago when I was first installing Python 3.x I had quite a bit of trouble and I feel I might have messed something up during the install or something.
Requirement satisfied means all its dependencies are installed already.
Related
I've installed anaconda on ubuntu, and after that I am unable to install packages it has with pip for every other project in which I use pyCharm. cmd says that when I want to import one of its packages:
Requirement already satisfied: pandas in /home/michal/anaconda3/lib/python3.7/site-packages (0.23.4)
Requirement already satisfied: python-dateutil>=2.5.0 in /home/michal/anaconda3/lib/python3.7/site-packages (from pandas) (2.7.3)
Requirement already satisfied: pytz>=2011k in /home/michal/anaconda3/lib/python3.7/site-packages (from pandas) (2018.5)
Requirement already satisfied: numpy>=1.9.0 in /home/michal/anaconda3/lib/python3.7/site-packages (from pandas) (1.15.1)
Requirement already satisfied: six>=1.5 in /home/michal/anaconda3/lib/python3.7/site-packages (from python-dateutil>=2.5.0->pandas) (1.11.0)
I am a new linux user, just started learning. Did I install anaconda wrong or do I have to somehow use pip only within venv for each particular package install?
I've tried to find answer online, I want to be able to use pip for packages again.
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'm trying to install sceptre with the command pip install sceptre. But I get the output below.
Requirement already satisfied: sceptre in /usr/local/lib/python3.9/site-packages (2.5.0)
Requirement already satisfied: Jinja2<3,>=2.8 in /usr/local/lib/python3.9/site-packages (from sceptre) (2.11.3)
Requirement already satisfied: PyYaml<6.0,>=5.1 in /usr/local/lib/python3.9/site-packages (from sceptre) (5.4.1)
Requirement already satisfied: networkx<3,>=2.4 in /usr/local/lib/python3.9/site-packages (from sceptre) (2.5.1)
Requirement already satisfied: click<8.0,>=7.0 in /usr/local/lib/python3.9/site-packages (from sceptre) (7.1.2)
Requirement already satisfied: boto3<2.0,>=1.3 in /usr/local/lib/python3.9/site-packages (from sceptre) (1.17.67)
Requirement already satisfied: colorama>=0.3.9 in /usr/local/lib/python3.9/site-packages (from sceptre) (0.4.4)
Requirement already satisfied: six<2.0.0,>=1.11.0 in /usr/local/lib/python3.9/site-packages (from sceptre) (1.16.0)
Requirement already satisfied: packaging<17.0,>=16.8 in /usr/local/lib/python3.9/site-packages (from sceptre) (16.8)
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /usr/local/lib/python3.9/site-packages (from boto3<2.0,>=1.3->sceptre) (0.10.0)
Requirement already satisfied: botocore<1.21.0,>=1.20.67 in /usr/local/lib/python3.9/site-packages (from boto3<2.0,>=1.3->sceptre) (1.20.67)
Requirement already satisfied: s3transfer<0.5.0,>=0.4.0 in /usr/local/lib/python3.9/site-packages (from boto3<2.0,>=1.3->sceptre) (0.4.2)
Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in /usr/local/lib/python3.9/site-packages (from botocore<1.21.0,>=1.20.67->boto3<2.0,>=1.3->sceptre) (2.8.1)
Requirement already satisfied: urllib3<1.27,>=1.25.4 in /usr/local/lib/python3.9/site-packages (from botocore<1.21.0,>=1.20.67->boto3<2.0,>=1.3->sceptre) (1.26.4)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.9/site-packages (from Jinja2<3,>=2.8->sceptre) (2.0.1)
Requirement already satisfied: decorator<5,>=4.3 in /usr/local/lib/python3.9/site-packages (from networkx<3,>=2.4->sceptre) (4.4.2)
Requirement already satisfied: pyparsing in /usr/local/lib/python3.9/site-packages (from packaging<17.0,>=16.8->sceptre) (2.4.7)
Tried this
pip uninstall sceptre
pip install sceptre
I read some questions here on stackoverflow. People usually resolve this issue with reinstalling the package. In my case, it didn't work. When I run pip list, I can see the version. But I can't run sceptre --version command. Where am I doing wrong?
Thanks!
I followed the Flask instructions and I successfully installed Flask by using Command Prompt.
C:\Users\DELL>py -3 -m pip install flask
C:\Users\DELL>py -3 -m pip install flask
Requirement already satisfied: flask in c:\users\dell\appdata\local\programs\python\python39\lib\site-packages (1.1.2)
Requirement already satisfied: itsdangerous>=0.24 in c:\users\dell\appdata\local\programs\python\python39\lib\site-packages (from flask) (1.1.0)
Requirement already satisfied: Jinja2>=2.10.1 in c:\users\dell\appdata\local\programs\python\python39\lib\site-packages (from flask) (2.11.2)
Requirement already satisfied: Werkzeug>=0.15 in c:\users\dell\appdata\local\programs\python\python39\lib\site-packages (from flask) (1.0.1)
Requirement already satisfied: click>=5.1 in c:\users\dell\appdata\local\programs\python\python39\lib\site-packages (from flask) (7.1.2)
Requirement already satisfied: MarkupSafe>=0.23 in c:\users\dell\appdata\local\programs\python\python39\lib\site-packages (from Jinja2>=2.10.1->flask) (1.1.1)
However when I use PyCharm to import flask, it doesn't recognize flask.
ModuleNotFoundError: No module named 'flask'
The most probable problem is py command is related with python2 and flask module is installed in your python3 site-packages. So try to execute explicitly with python3 as :
python3 app.py
I installed a package to python3.7 but when I try to run the executable its getting invoked from python2.7 and it fails as its not present in python3.7
$ sudo -H pip install blobbycompanyconnect --index https://pypi.company.com/simple --user
Looking in indexes: https://pypi.company.com/simple, https://pypi.company.com/simple
Requirement already satisfied: blobbycompanyconnect in /private/var/root/.local/lib/python3.7/site-packages (1.0.0)
Requirement already satisfied: trovecompanyconnect<3.0,>=2.0 in /private/var/root/.local/lib/python3.7/site-packages (from blobbycompanyconnect) (2.0.2)
Requirement already satisfied: filelock==3.0.12 in /private/var/root/.local/lib/python3.7/site-packages (from blobbycompanyconnect) (3.0.12)
Requirement already satisfied: python-dateutil in /private/var/root/.local/lib/python3.7/site-packages (from blobbycompanyconnect) (2.8.1)
Requirement already satisfied: backoff<2.0.0,>=1.8.0 in /private/var/root/.local/lib/python3.7/site-packages (from trovecompanyconnect<3.0,>=2.0->blobbycompanyconnect) (1.10.0)
Requirement already satisfied: argcomplete<2.0.0,>=1.6.0 in /private/var/root/.local/lib/python3.7/site-packages (from trovecompanyconnect<3.0,>=2.0->blobbycompanyconnect) (1.12.0)
Requirement already satisfied: pyotp==2.3.0 in /private/var/root/.local/lib/python3.7/site-packages (from trovecompanyconnect<3.0,>=2.0->blobbycompanyconnect) (2.3.0)
Requirement already satisfied: requests<3.0.0,>=2.18.4 in /private/var/root/.local/lib/python3.7/site-packages (from trovecompanyconnect<3.0,>=2.0->blobbycompanyconnect) (2.23.0)
Requirement already satisfied: pyaml==19.4.1 in /private/var/root/.local/lib/python3.7/site-packages (from trovecompanyconnect<3.0,>=2.0->blobbycompanyconnect) (19.4.1)
Requirement already satisfied: six>=1.5 in /private/var/root/.local/lib/python3.7/site-packages (from python-dateutil->blobbycompanyconnect) (1.15.0)
Requirement already satisfied: importlib-metadata<2,>=0.23; python_version == "3.7" in /private/var/root/.local/lib/python3.7/site-packages (from argcomplete<2.0.0,>=1.6.0->trovecompanyconnect<3.0,>=2.0->blobbycompanyconnect) (1.7.0)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /private/var/root/.local/lib/python3.7/site-packages (from requests<3.0.0,>=2.18.4->trovecompanyconnect<3.0,>=2.0->blobbycompanyconnect) (1.25.10)
Requirement already satisfied: chardet<4,>=3.0.2 in /private/var/root/.local/lib/python3.7/site-packages (from requests<3.0.0,>=2.18.4->trovecompanyconnect<3.0,>=2.0->blobbycompanyconnect) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /private/var/root/.local/lib/python3.7/site-packages (from requests<3.0.0,>=2.18.4->trovecompanyconnect<3.0,>=2.0->blobbycompanyconnect) (2020.6.20)
Requirement already satisfied: idna<3,>=2.5 in /private/var/root/.local/lib/python3.7/site-packages (from requests<3.0.0,>=2.18.4->trovecompanyconnect<3.0,>=2.0->blobbycompanyconnect) (2.10)
Requirement already satisfied: PyYAML in /private/var/root/.local/lib/python3.7/site-packages (from pyaml==19.4.1->trovecompanyconnect<3.0,>=2.0->blobbycompanyconnect) (5.3.1)
Requirement already satisfied: zipp>=0.5 in /private/var/root/.local/lib/python3.7/site-packages (from importlib-metadata<2,>=0.23; python_version == "3.7"->argcomplete<2.0.0,>=1.6.0->trovecompanyconnect<3.0,>=2.0->blobbycompanyconnect) (3.1.0)
You are using pip version 19.0.3, however version 20.2.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Error:-
$ blobbycompanyconnect
Traceback (most recent call last):
File "/usr/local/bin/blobbycompanyconnect", line 6, in <module>
from blobbycompanyconnect.cli import main
File "/Library/Python/2.7/site-packages/blobbycompanyconnect/cli.py", line 6, in <module>
from .companyconnect import get_cli_creds
File "/Library/Python/2.7/site-packages/blobbycompanyconnect/companyconnect.py", line 5, in <module>
from trovecompanyconnect.companyconnect_auth_api import companyconnectAuthApi, AppToApp, BOLTENV
ImportError: No module named trovecompanyconnect.companyconnect_auth_api
Your project runs on 2.7. I don't know if you use a virtual environment, maybe you should upgrade python there or on your IDE mostly on the right bottom you can see your python version check it.