Reputation: 98
I am running Visual Studio Code on two machines, both set up essentially the same way. One is an iMac, the other a MacBook Air. In one of my projects, on the iMac, it doesn't recognize that pandas is installed, even though it is in the environment.
Here is the VSC python interpreter selection:
And here you can see that:
I've tried uninstalling pandas and reinstalling it, but that doesn't help. I've tried making sure it's in the non-env python install (it is), but that doesn't help.
I have other projects on the same computer set up essentially the same way, and pandas works fine. I also have the same project on my laptop, with the same setup, and it is working there too. I'm kinda stumped. I guess I'll be working on it on the laptop for now, but I'd appreciate any insight people may have...
import pip
pip.main(["freeze"])
Thank you! Dylan
Upvotes: 1
Views: 3262
Reputation: 10354
According to your description, it is command that you could refer to the following steps:
Enter the current virtual environment in VSCode.
Enter 'pip --version
' to check if the pip currently used is from the current environment: (This ensures that using pip to install pandas module will be put into the current virtual environment.)
After installation:(I use the command 'pip install pandas
'(windows10), mac: pip3 install pandas
)
If it still has wavy lines, try reloading vscode.(Ctrl+Shift+p
, Developer: Reload windows
). The module pandas can be used:
Check the installation package:
If the pip list shows the pands module, but we still can't use it, we can find the current virtual environment folder and check whether there is pandas installation package:
Upvotes: 1