pipenv is installed, but $ pipenv --version shows as command not found - python

Newbie here not understanding how pipenv can simultaneously show as installed and not installed at the same time. Am using Windows 10 (2004) in the VS Code terminal:
$ pip install pipenv returns this:
Requirement already satisfied: pipenv in c:\users\billa\appdata\roaming\python\python37\site-packages (2018.11.26)
Requirement already satisfied: virtualenv-clone>=0.2.5 in c:\users\billa\appdata\roaming\python\python37\site-packages (from pipenv) (0.5.3)
Requirement already satisfied: certifi in c:\users\billa\appdata\local\programs\python\python37\lib\site-packages (from pipenv) (2019.6.16)
Requirement already satisfied: virtualenv in c:\users\billa\appdata\local\programs\python\python37\lib\site-packages (from pipenv) (16.7.7)
Requirement already satisfied: setuptools>=36.2.1 in c:\users\billa\appdata\local\programs\python\python37\lib\site-packages (from pipenv) (44.0.0)
Requirement already satisfied: pip>=9.0.1 in c:\users\billa\appdata\local\programs\python\python37\lib\site-packages (from pipenv) (20.1.1)
But:
$ pipenv --version
Returns this:
$ pipenv: command not found
Perplexingly, if I use Ubuntu in Windows terminal, it reports back properly:
$ pipenv, version 2020.6.2
Thanks in advance.

Related

Create Virtual Environment The system cannot find the path specified

I want to active venv in new folder , when i write "D:\pythonproject\first_django>env\Scripts\activate" in cmd I get " The system cannot find the path specified."
also I installed venv , when I run this command "pip install virtualenv" in cmd get "Requirement already satisfied: virtualenv in c:\users\sam\appdata\local\programs\python\python310\lib\site-packages (20.13.0)
Requirement already satisfied: filelock<4,>=3.2 in c:\users\sam\appdata\local\programs\python\python310\lib\site-packages (from virtualenv) (3.4.2)
Requirement already satisfied: distlib<1,>=0.3.1 in c:\users\sam\appdata\local\programs\python\python310\lib\site-packages (from virtualenv) (0.3.4)
Requirement already satisfied: six<2,>=1.9.0 in c:\users\sam\appdata\local\programs\python\python310\lib\site-packages (from virtualenv) (1.16.0)
Requirement already satisfied: platformdirs<3,>=2 in c:\users\sam\appdata\local\programs\python\python310\lib\site-packages (from virtualenv) (2.4.1)"
can any one tell me what's problem?
I use win11 and python 3.10
Follow the below steps :
To create virtual environment
py -m venv env
To activate it
env\scripts\activate
Then proceed with your pip installations in a virtual environment.

what is the best way to solve some Python packages that could not installed by conda

Recently I am facing a embrassing problem is that some Python packages must install using pip. I have read the pip and conda difference:
What is the difference between pip and conda?
I think many people facing the same problem that when you choose conda, then some package could not using conda install, when you use pip install the pacakge, it could not imported into the local project because the project only could import pakcage installed by conda install command. For example I want to use eyeD3 to read the mp3 meta data, but the package could not installed by conda, I installed the package using pip but could not import in the PyCharm IDE. What is the best way to solve this conflict? Am I missing something? Or I have to switch to pip? is it possible to make conda could install package from pip? Any suggestion is welcome, I want to fetch a guidline. I have tried install package like this in the macOS Big Sur:
/usr/local/anaconda3/envs/pydolphin ⌚ 22:20:21
$ ./bin/python -m pip install eyed3 ‹ruby-2.7.2›
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: eyed3 in ./lib/python3.9/site-packages (0.9.6)
Requirement already satisfied: filetype<2.0.0,>=1.0.7 in ./lib/python3.9/site-packages (from eyed3) (1.0.8)
Requirement already satisfied: coverage[toml]<6.0.0,>=5.3.1 in ./lib/python3.9/site-packages (from eyed3) (5.5)
Requirement already satisfied: deprecation<3.0.0,>=2.1.0 in ./lib/python3.9/site-packages (from eyed3) (2.1.0)
Requirement already satisfied: toml in ./lib/python3.9/site-packages (from coverage[toml]<6.0.0,>=5.3.1->eyed3) (0.10.2)
Requirement already satisfied: packaging in ./lib/python3.9/site-packages (from deprecation<3.0.0,>=2.1.0->eyed3) (21.3)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in ./lib/python3.9/site-packages (from packaging->deprecation<3.0.0,>=2.1.0->eyed3) (3.0.6)
(base)
still could not import this pakacage in the PyCharm IDE. I could found the package from the env:
/usr/local/anaconda3/envs/pydolphin/lib/python3.9/site-packages/eyed3

Why Python repo is not installed in WSL?

From my WSL terminal
pip install schemathesis
Requirement already satisfied: schemathesis in /home/milenko/.local/lib/python3.8/site-packages (3.9.7)
Requirement already satisfied: hypothesis_jsonschema>=0.20.1 in /home/milenko/.local/lib/python3.8/site-packages (from schemathesis) (0.20.1)
Requirement already satisfied: requests<3.0,>=2.22 in /usr/lib/python3/dist-packages (from schemathesis) (2.22.0)
Requirement already satisfied: pytest>4.6.4 in /home/milenko/.local/lib/python3.8/site-packages (from schemathesis) (6.2.5)
Requirement already satisfied: pytest-subtests<1.0,>=0.2.1 in /home/milenko/.local/lib/python3.8/site-packages (from schemathesis) (0.5.0)
When I try
:/mnt/c/Users/v-mimaholmes$ schemathesis
I got
schemathesis: command not found
If I try what Tzane suggested
python3 -m schemathesis
/usr/bin/python3: No module named schemathesis.__main__; 'schemathesis' is a package and cannot be directly executed
Outout from pip freeze
requests-unixsocket==0.2.0
schemathesis==3.9.7
SecretStorage==2.3.1
Why?
I do not have .local/lib.
On WSL the install location for the schemathesis -script is not in $PATH as Shinra tensei correctly assumed. I tried installing it myself on WSL Ubuntu and got the following:
The script schemathesis is installed in '/home/taneli/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
and got the same error as you. After adding ~/.local/bin to $PATH it now works as intended:
export PATH=$PATH:~/.local/bin
Not a linux wizard so I followed this about the appending to $PATH: https://unix.stackexchange.com/a/26059

Importing matplotlib gives error even though installed

I was hoping someone could help me out.
System is MacOS Catalina.
Python 3.8
IDE: VS
I installed matplotlib using pip install matplotlib which I saw stuck in under python2.7. I uninstalled matplotlib and reinstalled it using pip3 install matplotlib and received the following message:
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/site-packages (from matplotlib) (0.10.0)
Requirement already satisfied: numpy>=1.11 in /usr/local/lib/python3.7/site-packages (from matplotlib) (1.18.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.7/site-packages (from matplotlib) (2.4.6)
Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/site-packages (from matplotlib) (1.1.0)
Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.7/site-packages (from matplotlib) (2.8.1)
Requirement already satisfied: six in /Users/apple/Library/Python/3.7/lib/python/site-packages (from cycler>=0.10->matplotlib) (1.13.0)
Requirement already satisfied: setuptools in /usr/local/lib/python3.7/site-packages (from kiwisolver>=1.0.1->matplotlib) (46.0.0)
However, when I try to run my .py file with 'import matplotlib' it gives this error:
import matplotlib as mpl
ModuleNotFoundError: No module named 'matplotlib'
I've tried searching different sources for the solution but I am now stuck.
You are mostly running your python script with the command python your_file.py, try running as python3 your_file.py in your terminal. pip3 installs packages under python3, not the default python2.
This is because I believe your mac terminal uses python 2.x by default, therefore the command python uses python 2.x version and python3 uses 3.x version that is available to execute the files. So if you want to install any packages under python 2.x you use pip as the command and to install packages under python 3.x you use pip3 as the command

How to fix "conda: not found" error in Ubuntu

I was trying to download the graphviz library via conda in Jupyter Notebook (later I checked in terminal it goes in the same way). Unfortunately, I see the warning conda not found.
Firstly, I wrote this (in Jupyter):
!pip install conda --user
and got:
Requirement already satisfied: conda in /home/user_name/.local/lib/python3.6/site-packages (4.3.16)
Requirement already satisfied: pycosat>=0.6.1 in /home/user_name/.local/lib/python3.6/site-packages (from conda) (0.6.3)
Requirement already satisfied: ruamel.yaml>=0.11.14 in /home/user_name/.local/lib/python3.6/site-packages (from conda) (0.16.1)
Requirement already satisfied: requests>=2.12.4 in /usr/lib/python3/dist-packages (from conda) (2.18.4)
Requirement already satisfied: ruamel.yaml.clib>=0.1.2; platform_python_implementation == "CPython" and python_version < "3.8" in /home/user_name/.local/lib/python3.6/site-packages (from ruamel.yaml>=0.11.14->conda) (0.1.2)
After, I wrote next:
!conda install python-graphviz --yes
but it showed:
/bin/sh: 1: conda: not found
How can I fix this error to use conda?
conda is not a pip package. I think some backlevel version once got released on PyPI, but I wouldn't try to use that nowadays.
Install the Miniconda package to use conda:
https://docs.conda.io/en/latest/miniconda.html
And tell pip to remove that conda package it installed.

Categories

Resources