Re use the venv that's already created in a given folder - python-venv

I used to keep my projects in a HDD and recently changed my pc. Now when I try to activate the virtual environment using:
.\wfa_virtual\Scripts\activate
it activates the environment but when I try to install a new package using the command:
pip install --upgrade google-cloud-bigquery
it gives me error saying:
Fatal error in launcher: Unable to create process using '"f:\yoptima_bcup\yoptima_curr\universaldashboard\workflowautomationnew\wfa_instancebcup\workflow-automation\workflowautomation\wfa_virtual\scripts\python.exe"
The only change in the folder location is D drive from f drive, how can I let my venv know that the location has been changed?
Edit: I have also tried updating:
VIRTUAL_ENV="D:\yoptima_bcup\Yoptima_Curr\universalDashboard\workFlowAutomationNew\wfa_instanceBcup\workflow-automation\workFlowAutomation\wfa_venv" in activate file and also:
set VIRTUAL_ENV=D:\yoptima_bcup\Yoptima_Curr\universalDashboard\workFlowAutomationNew\wfa_instanceBcup\workflow-automation\workFlowAutomation\wfa_venv
in activate.bat file but no effect.

Related

Error when installing a python module in Linux

I am encoutering two kinds of issues while trying to install a package called Boltztrap2.
1) Trying to install Boltztrap2 using 'pip3'. However, when I punch in the command, the process goes smoothly for a while and then spits out an error :
BoltzTraP2/sphere/frontend.cpp:32:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
I did some troubleshooting and found out that it is just a path issue - I confirmed this by typing 'locate Python.h'. However, I don't get how to manually incorporate this change since the 'pip3' command that I use downloads the program and compiles it automatically. I don't seem to have access to change any scripts, or rather I do not know how to, since I'm kind of new to all this.
PS: I do not have sudo access.
2) Trying to install Boltztrap2 by manually compiling the python setup file: This seems to work fine until the system spits out an error saying:
Error:numpy is not installed.
PS: Again, I do not have sudo access.
I would be very glad if someone could help me install this package through either method. I just want to get the software to work. Thanks in advance for any assistance.
python3 -m pip install --upgrade pip
pip3 install numpy
Check if you can upgrade pip?
If that works then you can pip install numpy.

ModuleNotFoundError: No module name 'Cython'

I am trying to install pandas module on PyCharm. When i try to install it it gave me this error: "ModuleNotFoundError: No module name 'Cython' " (Screen: https://prnt.sc/qafwcy)
So i went on the CMD to try to install the Cython package with this command: py -m pip install Cython , which gave me an other error: "The script, f2py.exe is install in 'C:\xxx.xxxx, which is not a PATH. (Screen: https://prnt.sc/qafvx3)
Does anyone had the same problem and know how to fix it?
Thank you
Pycharm uses a virtual environment - one separate from your python install on your computer. This is to isolate your development environment from the one you would use on your computer.
Enter your pip commands here instead:

How to install pyqt5 on a virtual machine?

I have a google cloud platform virtual machine and I'm trying to run a python code using pyqt5 library.
I managed to install the miniconda distribution and all libraries I need (including pyqt5) but I'm having a problem while executing that code :
from PyQt5 import QtWebEngineWidgets
getting this error :
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
After searching in forums, I understood that it's because I may have a virtual machine (through SSH, OS : Ubuntu 19.04 amd64 disco image built on 2019-07-24) without window manager. I then installed the window manager Awesome but I got the same error.
I then tried unhopefully to solve the error by doing:
sudo apt update
sudo apt install libgl1-mesa-glx
as seen in a forum and I got a different error:
ImportError: libXss.so.1: cannot open shared object file: No such file or directory
but I think it's the same core problem.
Does anyone have an idea ?
Thank you for your help and your time !

No module named install

Yes you read it right!
I am trying to install pygame, so I downloaded the whl file and copied it to my project's folder, in the command prompt I navigated to the folder and entered
python -m install --user pygame-1.9.2-cp35-cp35m-win32.whl
Now if you can help me here that would be really appreciated, why is the error so rare that I couldn't find it anywhere.
Python doesn't have a module called "install". The module you're looking for is probably pip.
Just type in the command prompt:
python -m pip install --user pygame-1.9.2-cp35-cp35m-win32.whl
And pygame should start being installed.

ImportError:libcudart.so.8.0:cannot open shared object file:No such file or directory

I used the spyder or terminal to run the mnist_deep.py program , it can run normally, but when i run the program using pycharm, it will cause an error.The Project Interpreter is 2.7.12(~/anaconda2/bin/python).
Error Type:
ImportError:libcudart.so.8.0:cannot open shared object file:No such file or directory
Error importing tensorflow.Unless you are using bazel,you should not try to import tensorflow from its source directory;please exit the tensorflow source tree,and relaunch your python interpreter from there
It's preferable to do a system-wide configuration instead of editing ~/.bashrc. Create a .conf file in /etc/ld.so.conf.d/:
sudo nano /etc/ld.so.conf.d/nvidia.conf
Add this:
/usr/local/cuda-8.0/lib64
/usr/local/cuda-8.0/lib # you probably don't need this line; check
# if the directory exists
Then run sudo ldconfig. Hope this brings you joy.
In my case, I had installed tensorflow-gpu on a machine without a GPU.
Uninstalling it fixed the problem
pip uninstall tensorflow-gpu
pip install tensorflow --ignore-installed
Without the 2nd step, I was getting an error No module named tensorflow (ref)