Questions tagged [pythonpath]

PYTHONPATH is an environment variable that can be used to augment the default search path for module imports in Python.

PYTHONPATH is an environment variable that can be used to augment the default search path for module files in Python. Values will be added to sys.path.

758 questions
0
votes
2 answers

To get PYTHONPATH correct in running Django

I run at a cloned Django repository python manage.py runserver I get Traceback (most recent call last): File "manage.py", line 2, in from django.core.management import execute_manager ImportError: No module named…
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
0
votes
2 answers

IPython Search PYTHONPATH for file

Is there any way to make it so that IPython searches through your system path to find a file if only the name of the file is given? I have a file foo_060112.dat that lives in a folder containing a lot of data files that are uniquely named in a…
BFTM
  • 3,225
  • 6
  • 23
  • 22
-1
votes
3 answers

PYTHONPATH from launch.json not visible in Python script (VS Code)

I would like to import methods from a directory one level above my current working directory. One way to do this is to manually append the directory to sys.path. I found a better solution for VSCode on this post. The solution described there…
vpk
  • 1,240
  • 2
  • 18
  • 32
-1
votes
1 answer

Ubuntu Virtualbox: PYTHONPATH gone after restart

I use ubuntu 20.04 on virtualbox and set the python path with the given command export PYTHONPATH="/path/to/local/folder/" where my source files for modules I want to load are located. But everytime I reboot the VM, the python path is reset, echo…
Phobos
  • 111
  • 4
-1
votes
1 answer

In linux how to set Python so that when using python it will use python3 and not python 2.7

When I type python --version it gives python --version I would like the default behaviour to use python3. I do not what to have to type "python3" each time I create to run python. In linux hwo would I change this?
kumar
  • 8,207
  • 20
  • 85
  • 176
-1
votes
1 answer

PYTHONPATH exported multiple times when added to .zprofile

I recently was trying to add a directory to PYTHONPATH using .zprofile and it worked, but it adds the directory over and over again so when I echo $PYTHONPATH it shows /Users/will/Python: over and over maybe 1000 times or so. This is what I have in…
-1
votes
1 answer

Adding PYTHONPATH to .zprofile/.bash_profile

I need to add the contents of a directory called Python with many folders in it containing python scripts to my PYTHONPATH in zsh to allow them to be imported. So far I am planning on using a for loop to iterate through the directories and add the…
-1
votes
1 answer

Python from different user accounts

I have an older user account that I still use (rarely), and it has Python installed. In my current user account, I also have Python installed. However, if I try to run Python from cmd here, there are some issues because it actually starts from the…
fffrost
  • 1,659
  • 1
  • 21
  • 36
-1
votes
1 answer

How do I edit PYTHONPATH?

I have edited my PYTHONPATH in the .bashrc file but now I want to edit a section of it. I have a program which uses a particular source file, say libraryX So I set the PYTHONPATH to export PYTHONPATH="${PYTHONPATH}:/path1/" I added the above in…
SG213
  • 65
  • 1
  • 7
-1
votes
1 answer

UnicodeDecodeError: 'charmap' codec can't decode byte 0x81

I'm working on a project using Python(3.6) in which I need to read text files from a directory which can contain thousands of text files then I need to perform some analysis on them and upload the results to Google cloud storage. There's the…
Abdul Rehman
  • 5,326
  • 9
  • 77
  • 150
-1
votes
2 answers

How to change PYTHONPATH for Anaconda and Windows 7?

So my PYTHONPATH is set to a folder I don't want it set to. How do I change it? In Anaconda Prompt I've tried: set PYTHONPATH=C:\NewLocation But every time I do this PYTHONPATH is reset when I reopen Anaconda.
johnzilla
  • 338
  • 6
  • 21
-1
votes
1 answer

Python path rules

I've started a project using Object Oriented Programming but I have some trouble understanding some basic rules about paths. Here's the arborescence of my project: Project/ main.py classes/ Database.py database/ …
SlickKiss
  • 9
  • 3
-1
votes
2 answers

Throws Fatal Python error using command 'python3' in cmd

Trying to use python3 on win10. This is what I get when I try to use: > python3 myscript.py Fatal Python error: Py_Initialize: unable to load the file system codec File "C:\Python27\Lib\encodings\__init__.py", line 123 raise…
MattSom
  • 2,097
  • 5
  • 31
  • 53
-1
votes
3 answers

Import module from child folder to parent

So I looked at various similar problems asked here but so far nothing worked for me. I have the following file architecture: \folder __init__.py supClass.py script1.py \sub __init__.py script2.py So in script2.py I…
Mathieu Paurisse
  • 450
  • 4
  • 8
  • 17
-1
votes
2 answers

remove item from python path

I have added a path to the system pythonpath on linux and now i've broken it. How may I remove it ? [EDIT] Finally i solved it removing the script that added that path + installing something to rebuild the path.
Teodor Pripoae
  • 1,388
  • 1
  • 11
  • 26
1 2 3
50
51