Reputation: 3
I've been trying to learn Python via "Learn Python the Hard Way", and in ex46 he told us to put a script in bin and install it with setup.py
.
My script's name was testscript3.py
:
from test3 import printstring
printstring.printstring("this is a test")
test3.py
was like that:
def printstring(s='you did not provide string'):
print s
After making them I added the script to the setup.py
:
'scripts': [bin/testscript3.py],
and in PowerShell I wrote:
python setup.py install
in order to install it, but I got an error:
testscript3 is not defined
I tried to import it by doing:
from bin import testscript3
but still getting the same problem.
Upvotes: 0
Views: 32
Reputation: 939
You need to use a string in your setup.py The reason you're getting testscript3 is not defined
is because without the quotes around bin/testscript3.py
Python expects bin/testscript3.py
to be a variable.
'scripts': ['bin/testscript3.py'],
Upvotes: 1