0

I encounter the invalid syntax error below, when I run pypy, even when epto.py and conf_epto is located within the directory C:\Users\Acer\pypy2.7-v7.0.0-win32.

(snakes) C:\Users\Acer\pypy2.7-v7.0.0-win32>pypy
Python 2.7.13 (9112c8071614, Feb 06 2019, 23:10:08)
[PyPy 7.0.0 with MSC v.1500 32 bit] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>> pypy epto.py conf_epto 1
  File "<stdin>", line 1
    pypy epto.py conf_epto 1
         ^
SyntaxError: invalid syntax
>>>>

As per advise, I install the PyYaml package and I run again outside pypy console, as shown below:

(snakes) C:\Users\Acer\pypy2.7-v7.0.0-win32>pip install PyYaml
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting PyYaml
  Downloading https://files.pythonhosted.org/packages/1a/d6/b082e72e4556c2ef3dd9ec122f886b341187d677f32ee3081888762ab38d/PyYAML-5.1-cp27-cp27m-win_amd64.whl (210kB)
    100% |################################| 215kB 297kB/s
Installing collected packages: PyYaml
Successfully installed PyYaml-5.1

(snakes) C:\Users\Acer\pypy2.7-v7.0.0-win32>pypy epto.py conf_epto 1
Traceback (most recent call last):
  File "epto.py", line 14, in <module>
    import yaml
ImportError: No module named yaml
Casey Yeow
  • 15
  • 6
  • you shouldn't run `pypy epto.py conf_epto 1` inside the pypy console, rather run it on your cmd – Ashish Ranjan Mar 19 '19 at 03:50
  • Thx. Do you mean this way? I tried this: (snakes) (snakes) C:\Users\Acer\pypy2.7-v7.0.0-win32>pypy epto.py conf_epto 1 Traceback (most recent call last): File "epto.py", line 14, in import yaml ImportError: No module named yaml. Appreciate the reason why "import yaml" fail? – Casey Yeow Mar 19 '19 at 08:04
  • [so] is not for interactive debugging help, and adding an unrelated (from the problem perspective) question on top of your original one is going to mmke that less useful than either one on its own. If not for anything else, we have to read through the first part, think about a solution, and then hopefully find out by looking at the comments that the problem was resolved. You should make a new question in such a situation (and you are probably using the wrong pip executable, otherwise you would have the deprecation warning in your first run as well) – Anthon Mar 19 '19 at 09:38
  • Thx for highlighting. I will make a new question. – Casey Yeow Mar 19 '19 at 09:40

0 Answers0