omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    sys.path does not seem to have priority for current directory over site-packages directories

    Pythonista
    1
    2
    1629
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • caddtec
      caddtec last edited by

      Hello everyone,

      There seems to be a problem or maybe I misunderstood the search path algorithm... I have a module in site-packages-3 and the same one but in an other dev directory (iCloud) to work on the next version. With the new WorkingCopy directory sync feature, it is just awesome to code on my iPad! However, even though when I print the sys.path and I can see that my dev directory (current directory) is really first in the array over site-packages-3, it still uses site-packages-3 and thus my old module instead of the one I want to test in my current dev directory.

      I have tried to look for a similar problem in the forum and elsewhere on the web but nothing. Did anyone encountered this error? Am I not understanding the search algorithm right in Pythonista3?

      Any help would be very much appreciated.

      D

      1 Reply Last reply Reply Quote 0
      • caddtec
        caddtec last edited by

        Never mind, I understand my problem!

        At first I thought it was because the module is in cache but I restarted Pythonista and the problème was still there. However, it gave me a hint: how about the cache. That is when I realized the I am loading that very same module within pythonista_startup, which happens before I use my current directory.

        Problem solved! Probably the fastest resolution on the forum... my bad! LOL!! :o))

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Powered by NodeBB Forums | Contributors