leolani / cltl-chatbots

Series of chatbots that demonstrate Leolani’s functionalities
Apache License 2.0
0 stars 1 forks source link

source venv/bin/activate changes python version #5

Closed esg550 closed 2 years ago

esg550 commented 2 years ago

I got a Mac from Piek, but now I'm stuck at the fact that I need python 3.7 to download torch but this laptop has python 3.10. I made a virtual environment for python 3.7, but whenever I input source venv/bin/activate it changes the version to 3.10 again, making it that I can't install the requirements.txt which needs torch (which doesn't have a python 3.10 version)

(base) Minhs-MacBook-Pro:~ student$ source activate python37
(python37) Minhs-MacBook-Pro:~ student$ python --version
Python 3.7.11
(python37) Minhs-MacBook-Pro:~ student$ cd cltl-chatbots
(python37) Minhs-MacBook-Pro:cltl-chatbots student$ source venv/bin/activate
(venv) (python37) Minhs-MacBook-Pro:cltl-chatbots student$ python --version
Python 3.10.0
tae898 commented 2 years ago

Hey,

Btw, I personally use virtualenvwrapper, which is a wrapper for creating and deleting virtual environments. But either way, what you are using and I am doing are not so different.

What's the purpose of the below line btw?

(python37) Minhs-MacBook-Pro:cltl-chatbots student$ source venv/bin/activate

It looks to me that you are activating another virtual environment, while you have already activated python37 beforehand?

numblr commented 2 years ago

If you already created a virtual environment with conda I think you can also use that directly and skip the venv step. Just try to run pip install -r requirements.txt inside the conda environment. You might need to install pip first in the conda environement with conda install pip. If that doesn't work you need to remove the venv (deactivate it and remove the venv/ folder) and recreate it again using Python 3.7 when executing python -m venv venv. I'm not sure if that works from a conda environment though.