Good day! I created a small script, put it on github, now I want to add it to pypi.python.org, but there is a problem. In the main file, the first line contains the declaration:

#!/usr/bin/python3 

But when installing via pip in / usr / local / bin, a file is created, the first line of which is:

 #!/usr/bin/python 

When adding changes to the original file and re-installing the changes are saved, but the first line is still without the "3", and the script only works with the 3rd version :(

How to be?

    1 answer 1

    I decided to tell you how I coped with the problem. The fact is that there was an installation with pip for python 2.7. Since pip for python 3 is not very common yet, I fixed it by adding it ... in short, you can now use it with both python 2 and 3. Here is a piece of code:

     try: from urllib.request import urlopen except: from urllib import urlopen