Hope you're doing well,
I was trying to work on this django project from github but i could not download all the packages in a virtual environment, it says
(venv) C:\Users\me\Downloads\movie_recommender-master>pip install -r requirements.txt
Unable to create process using 'C:\Users\me\AppData\Local\Programs\Python\Python310\python.exe "C:\Users\me\Downloads\movie_recommender-master\venv\Scripts\pip.exe" install -r requirements.txt'
. I have read through tons of questions in stack over flow but nothing seems to work, I would be very grateful if you could help me here.
From all answers in comments I would say that it is quite clear - you are not activating your virtual environment or it is not setup correctly.
As I can understand from your text and comments your working directory is:
C:\Users\Joydeep Paul\Downloads\movie_recommender-master
and your virtual environment is at:
C:\Users\Joydeep Paul\Downloads\movie_recommender-master\venv
When you issue this commands:
where pip
where python
they need to point to your virtual environment (after you activate it with activate command) but instead they point to system wide versions:
C:\Users\me\AppData\Local\Programs\Python\Python310\python.exe
So to answer your question, one of the following has happened:
your system wide python installation is bad and it does not correctly setup virtual environment in your project
you haven't activated your virtual environment (although you say that you did)
there is some major issue with your windows installation or privileges
Maybe you can try to deactivate vritual environment issue where python3 statement and then activate it again and try once more where command?
Related
I have a issue with my virutal enviroment and I couldn't find a clear and straightforward awnser for it.
I had a fully working virtual enviroment with a lot of packages. My directory changed from "../Desktop/.." to "../Cloud_Name/Desktop/.." and lets assume i can't change that anymore.
I'm now able to cd into my eviroment and activate it.
If I now want to use any kind of command I get:
Fatal error in launcher: Unable to create process using "C: ..." "C: ..." the system cannot find the specified file.
I tried sofar to change the directory in "eviroment/Scripts/activate" and "eviroment/Scripts/activate.bat", but it doesn't work.
I don't want to install a new enviroment.
I'd be very thankfull if someone has a working solution to show my eviroment where its packages are.
Thank you in advance for your time and have a great day!
If you are able to activate your virtual environment, I suggest storing the installed packages (their names and version) into a requirements file by running pip freeze > requirements.txt Then recreate a new environment. After which you can reinstall your previous packages through pip install -r requirements.txt.
Virtualenv usually creates a symbolic link to reference package locations and I think after you changed the location of the environments, it did not (though it usually does not) update the symbolic links to the new location.
I created an application using py2app and have completed it. Running it on my machine has no problem, but I am concerned it might have problems such as missing module or other errors when run on someone else's with no programs installed. Is there a way to test this?
(sorry, I'm sure this is on the Internet but I'm not sure how to search for it)
you really can address your concern of module not found and ... on your current system by testing the app in an isolated virtual environment.
you can create a virtual environment, install the necessary package in it and see if it works
to do so:
I think the fastest easiest and most comfortable way is to use miniconda
to create a backup of the current ( or a fresh working virtual environment) and re-create one on another (or same) machine.
miniconda is an environment managing tool, a super lightweight version of conda (only ~60MB)
Just install miniconda from the instructions here.
Then create a new environment as below:
conda create --name newtestevironemnet python=3.9
So, the command will create an environment with only python. and then you can test your app see what no module error you will get and install packages.
whenever you reach a point where everything is working you can export necessary packages by :
conda env export > environment.yml
you can also create a requirement.txt file and tell the user to do pip install -r requirements.txt before running the app by:
conda list -e > requirements.txt
I'm a beginner to Django and Python, and I've never used virtualenv before. However, I do know the exact commands to activate and deactivate virtual environments (online search). However, this learning course takes time and sometimes I need to split the work over 2 days.
When I create a virtualenv today and do some work, I'm unable to access the same virtualenv tomorrow. Even when I navigate to that folder and type in .\venv\Scripts\activate, it says "system cannot find specific path".
How can I open already existing virtual environments and the projects within them? Could it be that I need to end my previous session in a certain way for me to access it the next time?
Even though pipenv had so many problems. I suggest you use it when you are new to virtual env.
Just
pip install pipenv
cd $your-work-directory
pipenv shell
Then you created your project env.
You can active it by:
cd $your-work-directory
pipenv shell
You can install packages by:
cd $your-work-directory
pipenv install $yourpackage --skip-lock
Open the command prompt
Go to the project directory, where you created virtual environment
And type the same as error shows, as in my case it was
File D:\Coding files\Python*recommendation-system\venv\Scripts\activate.ps1* cannot be loaded because running scripts is disabled on this system.
So I typed recommendation-system\venv\Scripts\activate.ps1
And it resolved my problem.
Use this and it will work:
cd $working directory u have virtual env on
pipenv shell
you can use this command it worked for me for reusing your existing venv
$ workon then the name of your existing venv
I am fairly new to using virtual environments for python projects but I have spent many hours trying to resolve this issue I've been having through various posts on this site and on others and have come up short. I have even resorted to uninstalling all python distributions and reinstalling with no luck.
I have the anaconda distribution of python installed on Windows 10. I have the problem that after I create a virtual environment, called venv, in a project folder I am unable to then activate this virtual environment using the anaconda prompt to install packages through pip. What I have done so far is as follows:
(base) C:\Users\[User]\Documents\GitHub\[project_folder]> virtualenv venv
This then successfully creates a virtual environment folder in my project folder called venv. Working in this directory I navigate to:
(base) venv> cd Scripts
(base) venv\Scripts> activate
There are a number of activate files to choose from and neither turns the environment from base to env as expected.
The reason I am using anaconda prompt as opposed to the standard command prompt or Windows PowerShell is because when I'm using the pip install <package> anywhere but in the anaconda prompt I get an error message that reads:
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
I'm not sure what this means and have tried to do some googling to solve this issue but to no avail. Note I do not have this issue when working on python projects on my MacBook and I can easily enter virtual environments and install the packages there with no issues. I'm relatively new to Windows so perhaps I'm missing something here...?
An interesting observation is that I can enter any virtual environment I've created through Windows PowerShell but I encounter the pip problem described above when trying to install packages into this environment.
I'm desperate for some help resolving this issue as it's greatly hindering the work on all my projects, and unfortunately I cannot just use my MacBook to code either.
use those command for python virtualenv
For activate
WINDOWS: activate nameofvenv
LINUX, macOS: source activate nameofvenv
For deactivate
WINDOWS: deactivate
macOS, LINUX: source deactivate
While working on a new python project and trying to learn my way through virtual environments, I've stumbled twice with the following problem:
I create my virtual environment called venv. Running pip freeze shows nothing.
I install my dependencies using pip install dependency. the venv library starts to populate, as confirmed by pip freeze.
After a couple of days, I go back to my project, and after activating the virtual environment via source venv/bin/activate, when running pip freeze I see the whole list of libraries installed in the system python distribution (I'm using Mac Os 10.9.5), instead of the small subset I wanted to keep inside my virtual environment.
I'm sure I must be doing something wrong in between, but I have no idea how could this happen. Any ideas?
Update:
after looking at this answer, I realized the that when running pip freeze, the pip command that's being invoked is the one at /usr/local/bin/pip instead of the one inside my virtual environment. So the virtual environment is fine, but I wonder what changes in the path might be causing this, and how to prevent them to happen again (my PYTHONPATH variable is not set).
I realized that my problem arose when moving my virtual environment folder around the system. The fix was to modify the activate and pip scripts located inside the venv/bin folder to point to the new venv location, as suggested by this answer. Now my pip freeze is showing the right files.