I'm new to programming and have spent the past few weeks studying python on my own. Most of the instruction has been from the resource "Learn Python the Hard Way".
Now to my problem, I just started working on a quiz that basically has you complete and install your own setup.py file. However, after spending some time understanding the file and trying to run it; I keep getting a 'Invalid Syntax' error on the second single quote here:
'packages': [ ],
.
I've tried everything that I can think of such as removing all the single quotes from the variables on the left side, replacing the colons with equal signs, renaming certain files and folders, or a combination of the three. I've compared the code to other sites offering similar tutorials. which is where the previous ideas arose, and have searched in several places including Google and stackoverflow.com for solutions to this problem. However, so far I haven't found any posts related to this particular situation.
I'm using Ubuntu 12.04 LTS as my operating system.
I have a screen shot of the problem, but i lack the reputation to post it here. : (
This code should be exactly like the code from "Learn Python the Hard Way" and I have only altered the variables as instructed, such as the name or email address.
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'Amateur Remake of the Clannad Visual Novel',
'author': 'Kristopher Anders',
'url': 'Unavailable Online.',
'download_url': 'Not Available online.',
'author_email': '[email protected]',
'version': '0.1',
'install_requires': ['nose']
'packages': ['seen0414'],
'scripts': [],
'name': 'Clannad Visual Novel'
}
setup(**config)
|---Clannad \\root directly for 'setup.py' \\
|---bin
|---docs
|---seen0414
|---__init__.py --\\contents is exact copy of 'seen0414.py'\\
|---__init__.pyc \\otherwise '__init__.py' was empty.\\
|---module0414.py --\\contains functions for 'seen0414'\\
|---module0414.pyc
|---script0414.txt --\\contains necessary text for 'module0414.py'\\
|---seen0414.py --\\original(main) script\\
|---tests
|---clannad_tests.py
|---clannad_tests.pyc
|---__init__.py
|---__init__.pyc
|---setup.py
I'm sure its probably a very simple solution, but i just can't seem to figure this one out. Thanks in advance for any help.
You can clear up this invalid syntax in Python by switching out the semicolon for a colon. Here, once again, the error message is very helpful in telling you exactly what is wrong with the line.
The pip install invalid syntax error is raised when you try to install a Python package from the interpreter. To fix this error, exit your interpreter and run the pip install command from a command line shell.
Installing Python Packages with Setup.py To install a package that includes a setup.py file, open a command or terminal window and: cd into the root directory where setup.py is located. Enter: python setup.py install.
If you get a "SyntaxError: invalid syntax" when trying to install a module using pip , make sure to run the command from your shell, e.g. bash or PowerShell, and not by running a Python file that contains the pip install your_module command.
'install_requires': ['nose']
Is missing the ,
Try
'install_requires': ['nose'],
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With