Create Virtual Environment The system cannot find the path specified - python

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.

Related

virtualenv env bash: virtualenv: command not found

I have a problem each time I want to start my VM even after Installing on windows
`
$ pip install virtualenv
Collecting virtualenv
Using cached virtualenv-20.16.6-py3-none-any.whl (8.8 MB)
Requirement already satisfied: platformdirs<3,>=2.4 in c:\users\samib\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from virtualenv) (2.5.2)
Requirement already satisfied: distlib<1,>=0.3.6 in c:\users\samib\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from virtualenv) (0.3.6)
Requirement already satisfied: filelock<4,>=3.4.1 in c:\users\samib\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from virtualenv) (3.8.0)
Installing collected packages: virtualenv
WARNING: The script virtualenv.exe is installed in 'C:\Users\samib\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\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 virtualenv-20.16.6
`
I have the error
virtualenv env bash: virtualenv: command not found
I tried to uninstall and install again but I have the same issue

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

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

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.

Module path order in virtualenv

I noticed a strange phenomenon related to dist-packages paths. The order of my paths in my system-wide installation of python 3 (simply running python3 and then printing sys.path) is as follows:
/usr/local/lib/python3.4/dist-packages
/usr/lib/python3/dist-packages
i.e. the path in local is preferred. However, creating a virtual environment and running python3 after activating the environment gives:
/usr/lib/python3/dist-packages
/usr/local/lib/python3.4/dist-packages
The order is clearly reversed. Yet, pip still searches local first, which results in a different version of a library seen by pip dependencies and a different one used when importing.
Can someone explain the discrepancy?
EDIT:
When the virtualenv is activated, the pip used is the one installed in the virtualenv:
pip 9.0.1 from ~/.virtualenv/python3/lib/python3.4/site-packages (python 3.4)
and yet, despite the path pointing first to dist-utils in /usr/lib, it does resolve dependencies with what's in /usr/local/lib:
pip3 install --upgrade setuptools
Requirement already up-to-date: setuptools in ./.virtualenv/python3/lib/python3.4/site-packages
Requirement already up-to-date: appdirs>=1.4.0 in ./.virtualenv/python3/lib/python3.4/site-packages (from setuptools)
Requirement already up-to-date: packaging>=16.8 in /usr/local/lib/python3.4/dist-packages (from setuptools)
Requirement already up-to-date: six>=1.6.0 in ./.virtualenv/python3/lib/python3.4/site-packages (from setuptools)
Requirement already up-to-date: pyparsing in /usr/local/lib/python3.4/dist-packages (from packaging>=16.8->setuptools)

Categories

Resources