As the question suggests i have a dual boot set up with python scripts stored in my windows partition.
I have ubuntu installed on a separate HDD and can successfully run python files that are stored within its own HDD.
The following script is saved as a copy in both the windows partition AND the ubuntu partition:
from bs4 import BeautifulSoup as bs4
import os
from tqdm import tqdm
import sys
print(sys.executable)
print(sys.path)
print('it worked')
Using two instances of VSCode using the ubuntu OS, I have the following results from trying to run the script from each file path:
path to file in windows partition:
/bin/python3 "/media/saleem/84E859C6E859B760/Users/sim77/Dropbox/Literature Searcher/Scripts/new.py"
(base) saleem@saleem-desktop:/media/saleem/84E859C6E859B760/Users/sim77/Dropbox/Literature Searcher/Scripts$ /bin/python3 "/media/saleem/84E859C6E859B760/Users/sim77/Dropbox/Literature Searcher/Scripts/new.py"
Traceback (most recent call last):
File "/media/saleem/84E859C6E859B760/Users/sim77/Dropbox/Literature Searcher/Scripts/new.py", line 1, in <module>
from bs4 import BeautifulSoup as bs4
ModuleNotFoundError: No module named 'bs4'
path to file in ubuntu partition:
(base) saleem@saleem-desktop:~$ source /home/saleem/anaconda3/bin/activate
(base) saleem@saleem-desktop:~$ conda activate base
(base) saleem@saleem-desktop:~$ /home/saleem/anaconda3/bin/python /home/saleem/Documents/new.py
/home/saleem/anaconda3/bin/python
['/home/saleem/Documents', '/home/saleem/anaconda3/lib/python38.zip', '/home/saleem/anaconda3/lib/python3.8', '/home/saleem/anaconda3/lib/python3.8/lib-dynload', '/home/saleem/anaconda3/lib/python3.8/site-packages', '/home/saleem/anaconda3/lib/python3.8/site-packages/locket-0.2.1-py3.8.egg']
it worked
From what i can see, when using the file from the windows partition, a different interpreter is being used. I am simply trying to use the same interpreter that works when using the latter path, but by accessing files from the first path.
Is there a way to do this efficiently?