Python Forum
setting pythonpath variable in environment variables
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
setting pythonpath variable in environment variables
#4
Quote:And what is the difference between
There are two hierarchies that don't coincide: the filesystem with its tree of folders and the python packages and subpackages system. For example xml.etree.ElementTree is a submodule of the xml.etree package which is a subpackage of xml.

The ..one means the subpackage 'one' of the current module's grandparent package. But you can't use it if you simply call python two/sample.py because when you do so the current module is __main__ which has no parent package nor grandparent package. If works if parent is a module with a subpackage two and a submodule sample, so it works if you call python -m parent.two.sample.

The filesystem tree helps to build python modules and packages, but there is no direct correspondance between them.
Reply


Messages In This Thread
RE: setting pythonpath variable in environment variables - by Gribouillis - Dec-05-2018, 10:33 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to set PYTHONPATH in Visual Studio Code? aupres 5 4,517 Aug-15-2023, 03:51 PM
Last Post: snippsat
  Setting permanent user variables in Windows coder420 2 1,453 Jan-04-2022, 10:42 AM
Last Post: Larz60+
Question Calling on a Variable using other Variables jacknewport 4 2,041 Jul-23-2021, 04:18 PM
Last Post: jacknewport
  Create new variable dependent on two existing variables JoeOpdenaker 6 3,122 Oct-25-2020, 02:15 PM
Last Post: jefsummers
  Print variable values from a list of variables xnightwingx 3 2,673 Sep-01-2020, 02:56 PM
Last Post: deanhystad
  Help Setting Multiple Variables bzowk 0 1,621 Jul-18-2020, 06:59 PM
Last Post: bzowk
  the exe file by generated by pyinstaller ,can't get the PYTHONPATH roger2020 11 7,131 Jan-14-2020, 11:07 AM
Last Post: roger2020
  Trouble Setting a Variable True basing on an Imput VictorVictus 5 2,814 Aug-02-2019, 08:14 PM
Last Post: VictorVictus
  TESSDATA_PREFIX environment variable is set to your "tessdata" directory. rajeev1729 1 4,105 Jun-10-2019, 04:47 PM
Last Post: Gribouillis
  Help with environment path variables kuharido 0 1,947 Jun-07-2019, 09:18 PM
Last Post: kuharido

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020