Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. broke my venv
Forum Updated to NodeBB v4.3 + New Features

broke my venv

Scheduled Pinned Locked Moved Solved Qt for Python
4 Posts 2 Posters 554 Views 1 Watching
  • 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.
  • C Offline
    C Offline
    CryptoJake
    wrote on last edited by CryptoJake
    #1

    I'm not sure how I managed it, but I broke my venv. I'm using Qt Creator and going through a bunch of tutorials. I have been using a single venv which included PySide6. This has been working for some time, but now, none of my tutorial projects works. When I run a project from within Qt Creator, or from the command line, I get the same result:

     C:\Users\mikek\cloud\VBPjts\python\qt\tutorials\venv\Scripts\python.exe: can't find '__main__' module in 'C:\\Users\\mikek'
    

    The *.py files are in the tutorials directory, but the venv python.exe call is now looking in a directory 4 levels up.

    Anyone know where this gets fixed?

    Note, most of these *.py files have a main function:
    if name == 'main':

    1 Reply Last reply
    0
    • C CryptoJake

      There is no __init__.py.

      I'm on Win11, and there is no PYTHONPATH environment variable.

      No, it doesn't happen with a dummy script.

      I think my question is wrong. It looks to be a QT Creator settings issue. It doesn't work in QT Creator. But if I activate the correct venv in a terminal window, I can run these scripts successfully.

      The problem seems to be that when I run a script from within Qt Creator it is looking for a script with the name of a directory 4 levels up from my working directory. I'm looking for working directory settings...

      C Offline
      C Offline
      CryptoJake
      wrote on last edited by
      #4

      I solved it. I couldn't figure out how it broke or how to fix it. But I was able to delete it and create another one in its place. The new one works fine.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        Do you have any __init__.py file in your project folder ?

        Was there a change to the PYTHONPATH environment variable ?

        Does it also happen with a dummy script ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        C 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          Do you have any __init__.py file in your project folder ?

          Was there a change to the PYTHONPATH environment variable ?

          Does it also happen with a dummy script ?

          C Offline
          C Offline
          CryptoJake
          wrote on last edited by CryptoJake
          #3

          There is no __init__.py.

          I'm on Win11, and there is no PYTHONPATH environment variable.

          No, it doesn't happen with a dummy script.

          I think my question is wrong. It looks to be a QT Creator settings issue. It doesn't work in QT Creator. But if I activate the correct venv in a terminal window, I can run these scripts successfully.

          The problem seems to be that when I run a script from within Qt Creator it is looking for a script with the name of a directory 4 levels up from my working directory. I'm looking for working directory settings...

          C 1 Reply Last reply
          0
          • C CryptoJake

            There is no __init__.py.

            I'm on Win11, and there is no PYTHONPATH environment variable.

            No, it doesn't happen with a dummy script.

            I think my question is wrong. It looks to be a QT Creator settings issue. It doesn't work in QT Creator. But if I activate the correct venv in a terminal window, I can run these scripts successfully.

            The problem seems to be that when I run a script from within Qt Creator it is looking for a script with the name of a directory 4 levels up from my working directory. I'm looking for working directory settings...

            C Offline
            C Offline
            CryptoJake
            wrote on last edited by
            #4

            I solved it. I couldn't figure out how it broke or how to fix it. But I was able to delete it and create another one in its place. The new one works fine.

            1 Reply Last reply
            0
            • C CryptoJake has marked this topic as solved on

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved