Home > database >  How to get python packages installed for 32 bit before but works on 64bit as well in Visual Code? E.
How to get python packages installed for 32 bit before but works on 64bit as well in Visual Code? E.

Time:04-28

I use (1) Windows 11,

(2) Python 3.7.8 for 64bit ; Python 3.8.3 for 32bit enter image description here

(3) Visual Studio Code.

I noticed that all my python packages are installed on 32Bit, is there any way to get my packages works on 64bit as well? Because I wish to use Pytorch, however, it only works on 64bit

enter image description here

I tried to install packages again, but it installed for my 32 bit? So it cannot install again? enter image description here

I checked my system path but I have no idea how to do with path for my packages?

enter image description here

I also installed PyTorch in Visual code, but it does not appear installed in my python environment...Why?

enter image description here

I tried to install PyTorch by pip and it gives me error as below: enter image description here

Updates: ------------------------------------------------ I tried: Ctrl Shift P, select that 64bit python enter image description here

Then, in the terminal I tried to install packages, it still shows that my package is already installed...

enter image description here

CodePudding user response:

You have selected Python3.7.8(64) in the jupyter notebook, while you have installed the python modules in the Python3.8.3(32) environment. So it will prompt No module named 'pandas'.

And looks like torch has no 32bit version, if you want to use it, you need to select Python3.7.8(64).

So, you can activate the terminal first through open a python file and then clicking the python interpreter on the bottom-right of the VSCode or choosing Python: Select Python interpreter in the command palette directly.

Then take the shortcut of Ctrl Shift ` to create a new terminal with the activated python environment. After this, you can install the modules in the right place.

You can refer to the official docs for more detail.

  • Related