Score:0

how to activate venv (python) on server production

am flag

I created a app based on Vuejs (frontend) and Node.js/Express (backend), both have domains and they are online on web.

Inside the backend, I have some files scripts written in Python which I also had to install some external libraries (pandas, numpy, selenium...).

IN LOCALHOST:

All works fine, I installed all external libraries in venv (virtual env) and i have to execute the following commands to work with:

source venv/bin/activate - to activate the venv

npm run start - to create a server in my localhost.

All python scripts are working well!

IN PRODUCTION (VPS):

My problem is here! All scripts which has a external lib does not work! I got the following error.

{ "traceback": "Traceback (most recent call last):\n File "scripts/script-03.py", line 10, in \n from selenium import webdriver\nModuleNotFoundError: No module named 'selenium'\n", "executable": "python3", "options": null, "script": "scripts/script-03.py", "args": [ "{}" ], "exitCode": 1 }

Before to deploy all files on VPS, I installed all libraries in localhost with venv activated! So, all libraries should be there and in localhost is ok there.

But according to the error message, venv is not activating because the message says 'No module named 'selenium'\n, but selenium is installed inside venv.

There is any way to let venv activated on VPS production? I should do something to make a deploy using venv and python?

All my code is public in github. If you want to check it. https://github.com/jdenari/metaseed/tree/master/backend

Thanks in advance

George Y avatar
vn flag
If you have really activated the python environment mentioned, you get `(venv)` in front of each line of the terminal prompt.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.