简体   繁体   中英

Python interpret and import problem with env or VS Code

I am trying to work on a university project from home. We created a Python environment with virtualenv, all on Windows 7. I work on macOS, but when I clone the repository and launch the environment with

source/Users/admin/Documents/GitHub/QTLab2122/SingleIRsource/daqenv/Scripts/activate

the environment is activated. But VS Code does not make me select as Python interpreter the python.exe present in Scripts and gives me error about the import of two packages: serial and niscope, despite being inside Lib. What it brings me back is

"Import" serial "could not be resolved" "Import" niscope "could not be resolved"

Is it due to the environment being created on Windows 7 and not macOS? Or is there something I'm missing?

Could you find these packages in your virtual environment on your mac? I think you need to reinstall these packages.

You can take pip freeze > requirements.txt to get the packages list on windows, and reinstall them on your mac through pip install -r requirements.txt .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM