Python Forum
using self-developed modules
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
using self-developed modules
#9
I uninstalled and reinstalled Python 3.7.4, no change: I still get error messages telling that the to-be-imported module (selfwrittenmodule.py) is not found.

Then I did read your replies and links to previous messages in great detail and I have been "trying" a lot. Adding the "sitecustomize.py" code in the importing module, prior to importing "selfwrittenmodule.py", seems to resolve the problem.

But first I started testing on what the effect could be of adding the path to the folder that contains the "to-be-imported" module to the "System Variables" or/and to the "User Variables for actname". Whether it is added to the "path", or whether it is added using an added "PYTHONPATH" does not matter, the error re-occurs. After all these changes to the Windows "PATH", "pprint (sys.path)" does not show the manually added path. Python seems not to be influenced by changes to the "System Variables" of the Win PC. This seems to contradict the manuals of Python 3.7.4! Or I misunderstand the statements that explain how and where to change the "System Variables".

Now I first want to find a way to avoid hardcoding, in the "importing" module, the path to the folder that contains the "selfwrittenmodule.py" module (hardcoding external data should ALWAYS be avoided!). If I find a way to avoid that in an elegant way, I will let you know if and how that can be done.

Thanks for your patience and for your excellent suggestions.
Reply


Messages In This Thread
using self-developed modules - by wlp - Aug-28-2019, 03:04 PM
RE: using self-developed modules - by wlp - Aug-28-2019, 04:05 PM
RE: using self-developed modules - by snippsat - Aug-28-2019, 05:41 PM
RE: using self-developed modules - by wlp - Aug-29-2019, 10:36 AM
RE: using self-developed modules - by perfringo - Aug-29-2019, 11:22 AM
RE: using self-developed modules - by snippsat - Aug-29-2019, 03:29 PM
RE: using self-developed modules - by wlp - Aug-29-2019, 04:18 PM
RE: using self-developed modules - by snippsat - Aug-29-2019, 05:20 PM
RE: using self-developed modules - by wlp - Aug-30-2019, 02:18 PM
RE: using self-developed modules - by snippsat - Aug-30-2019, 03:17 PM
RE: using self-developed modules - by wlp - Aug-30-2019, 04:16 PM
RE: using self-developed modules - by snippsat - Aug-30-2019, 07:10 PM
RE: using self-developed modules - by wlp - Aug-31-2019, 01:45 PM
RE: using self-developed modules - by snippsat - Aug-31-2019, 05:19 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Developed App in VS2019 - Help with pyinstaller fioranosnake 0 1,630 Nov-11-2019, 09:12 PM
Last Post: fioranosnake
  Modules issue, pip3 download modules only to pyhton3.5.2 not the latest 3.6.1 bmohanraj91 6 8,521 May-25-2017, 08:15 AM
Last Post: wavic

Forum Jump:

User Panel Messages

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