0

I will be running my CNC Via Arduino UNO R3, so i have found out that it runs on GRBL and that i need to load Python and Pyserial and a graphic interface. Loaded Python 3.5.2, no problems, opened dos window typed Python, got the python>>> prompt, so far so good, downloaded/unzipped/copy/paste Pyserial into c:/python35/lib/site-packages/pyserial. at this point, at the dos prompt i type>>>python setup.py install. All i get is a syntax error.

I have included the dos script for comment

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Goblin>python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (In
tel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.getcwd()
'C:\\Users\\Goblin'
>>> os.chdir("/users/")
>>> os.getcwd()
'C:\\users'
>>> os.chdir("/../")
>>> os.getcwd()
'C:\\'
>>> os.chdir("/python35/lib/site-packages/pyserial/")
>>> os.getcwd()
'C:\\python35\\lib\\site-packages\\pyserial'
>>> python setup.py install
 File "<stdin>", line 1
 python setup.py install
 ^
SyntaxError: invalid syntax
>>>

This is about the 7th attempt. I seem to be following the instruction correctly but it wont install ....HELP Please, this is so frustrating, what have I done wrong. Thanks in advance Doug

asked Aug 3, 2016 at 8:08
1
  • Dont do this within the python environment. Its meant to be run from the system command line. Navigate with 'cd' in Command Prompt to the pyserial folder and then run this command again. Commented Aug 3, 2016 at 15:59

3 Answers 3

2

not exactly related to Arduino but here it goes...

First check if you have pip installed:

pip --version

if not installed go here and download the get-pip script. then on directory where you saved get-pip run on console:

python get-pip.py

this will install pip into your system which makes installation of packages in python way more easy.

if installed but not latest version ( at momment 8.1.2) do an upgrade before:

On Linux or OS X:

pip install -U pip

On Windows:

python -m pip install -U pip

after install pyserial using pip:

pip install pyserial

Did it work? If not, try:

python -m pip install pyserial

if it still doesn't work install from source. Get the latest version here extract it and in the dir where you extrated run:

python setup.py install

PS: change to dir first, no need to do it inside python.

answered Aug 3, 2016 at 9:12
2

I'm pretty sure that what you are trying to do is actually call 'python setup.py' within the python script itself. Which you cannot do. The easiest way to install pyserial is via pip like so. (Windows)

python -m -U pyserial --upgrade 

Now if you still want to use setup.py or you don't have pip installed. Make sure that you meet all of the package dependencies. Which in pyserial there are no others. Try exiting out of the python interpreter and just running

python setup.py install

In the same folder location as the extracted zip (use cd to change directories)

answered Aug 3, 2016 at 9:40
0

Thanks All...by running the command at a std DOS prompt I was able to install the Pyserial.py file. i have since seen comments that some of the 3.x.x series Python has glitches,(I am running Windows7). I have gone to 2.7 Python as a program i would like to use doesn't appear to run under 3.x.x bCNC likes the earlier versions, not sure why, but it does run under 2.7 . for those interested JCNC, EFL CNC, Grbl Controller seem to run OK under 3.x.x

answered Aug 4, 2016 at 7:40

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.