Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Calling Setup.py in Ubuntu 20.04 does not work
Forum Updated to NodeBB v4.3 + New Features

Calling Setup.py in Ubuntu 20.04 does not work

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
11 Posts 3 Posters 2.0k Views
  • 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.
  • P PythonQTMarlem

    Hello,

    I have created a Setup.py file:

    import os
    import sys
    from setuptools import setup
    
    
    setup(name='PQT-Texteditor',
          version='1.0',
          description='Barrierefreier Texteditor der plattformunabhängig ist',
          author='Markus Lemcke',
          author_email='info@marlem-software.de',
          url='https://www.marlem-software.de',
          install_requires=['PyQt5'],
         )
    	 
    chmod +x setup.py
    python3 setup.py install
    

    I got the following error message:
    error: can't create or remove files in install directory

    The following error occurred while trying to add or remove files in the
    installation directory:

    [Errno 13] Permission denied: '/usr/local/lib/python3.8/dist-packages/test-easy-install-3247.write-test'
    

    The installation directory you specified (via --install-dir, --prefix, or
    the distutils default setting) was:

    /usr/local/lib/python3.8/dist-packages/
    

    Perhaps your account does not have write access to this directory? If the
    installation directory is a system-owned directory, you may need to sign in
    as the administrator or "root" account. If you do not have administrative
    access to this machine, you may wish to choose a different installation
    directory, preferably one that is listed in your PYTHONPATH environment
    variable.

    For information on other options, you may wish to consult the
    documentation at:

    https://setuptools.readthedocs.io/en/latest/easy_install.html

    Question:
    What does this error message say? What do I have to do so that I can run the setup.py file on Ubuntu?

    JonBJ Offline
    JonBJ Offline
    JonB
    wrote on last edited by JonB
    #2

    @PythonQTMarlem
    Just from reading what it says: you don't have permission to write into /usr/local/lib/python3.8/dist-packages/test-easy-install-3247.write-test. Either runs as a user who does and wishes to install there, or follow the suggestion of --install-dir ... to specify where you want it installed.

    ?

    1 Reply Last reply
    1
    • P Offline
      P Offline
      PythonQTMarlem
      wrote on last edited by
      #3

      thank you.
      This directory /usr/local/lib/python3.8/dist-packages/test-easy-install-3247.write-test can call:
      /usr/local/lib/python3.9/dist-packages/test-easy-install-3247.write-test
      /usr/local/lib/python4.0/dist-packages/test-easy-install-3247.write-test
      and so on.

      I think i have to look to --install-dir to define this in setup.py

      jsulmJ 1 Reply Last reply
      0
      • P PythonQTMarlem

        thank you.
        This directory /usr/local/lib/python3.8/dist-packages/test-easy-install-3247.write-test can call:
        /usr/local/lib/python3.9/dist-packages/test-easy-install-3247.write-test
        /usr/local/lib/python4.0/dist-packages/test-easy-install-3247.write-test
        and so on.

        I think i have to look to --install-dir to define this in setup.py

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #4

        @PythonQTMarlem Just to add to @JonB /usr/local is not writeable by non root users. If you want to install there you have to use sudo.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • P Offline
          P Offline
          PythonQTMarlem
          wrote on last edited by PythonQTMarlem
          #5

          @jsulm Thank you.
          You think: sudo python3 setup.py install
          Right?
          Do you know where I find Code Examples?

          jsulmJ 1 Reply Last reply
          0
          • P PythonQTMarlem

            @jsulm Thank you.
            You think: sudo python3 setup.py install
            Right?
            Do you know where I find Code Examples?

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #6

            @PythonQTMarlem Code examples for what?
            To use sudo you just do

            sudo ./Setup.py
            

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • P Offline
              P Offline
              PythonQTMarlem
              wrote on last edited by PythonQTMarlem
              #7

              @PythonQTMarlem said in Calling Setup.py in Ubuntu 20.04 does not work:

              You think: sudo python3 setup.py install
              Right?

              jsulmJ 1 Reply Last reply
              0
              • P PythonQTMarlem

                @PythonQTMarlem said in Calling Setup.py in Ubuntu 20.04 does not work:

                You think: sudo python3 setup.py install
                Right?

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #8

                @PythonQTMarlem Yes, but python3 should not be necessery if you have

                #!/usr/bin/env python3
                

                as first line in setup.py and if setup.py is executable.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                1
                • P Offline
                  P Offline
                  PythonQTMarlem
                  wrote on last edited by
                  #9

                  @jsulm said in Calling Setup.py in Ubuntu 20.04 does not work:

                  #!/usr/bin/env python3

                  sudo python3 setup.py install works. Thank you.

                  The #! / Usr / bin / env python3 doesn't always work. But that's the next topic I'm going to deal with.

                  JonBJ 1 Reply Last reply
                  0
                  • P PythonQTMarlem

                    @jsulm said in Calling Setup.py in Ubuntu 20.04 does not work:

                    #!/usr/bin/env python3

                    sudo python3 setup.py install works. Thank you.

                    The #! / Usr / bin / env python3 doesn't always work. But that's the next topic I'm going to deal with.

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by
                    #10

                    @PythonQTMarlem said in Calling Setup.py in Ubuntu 20.04 does not work:

                    The #! / Usr / bin / env python3 doesn't always work. But that's the next topic I'm going to deal with.

                    Look forward to reading what you say about that not working :)

                    jsulmJ 1 Reply Last reply
                    0
                    • JonBJ JonB

                      @PythonQTMarlem said in Calling Setup.py in Ubuntu 20.04 does not work:

                      The #! / Usr / bin / env python3 doesn't always work. But that's the next topic I'm going to deal with.

                      Look forward to reading what you say about that not working :)

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #11

                      @JonB said in Calling Setup.py in Ubuntu 20.04 does not work:

                      Look forward to reading what you say about that not working :)

                      Executable bit not set? :-)

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      2

                      • Login

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