Go to Post Representing data in a good way is an art in its own right. - Andrew Schreiber [more]
Home
Go Back   Chief Delphi > Technical > Programming > Python
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 26-01-2016, 21:51
climavarus's Avatar
climavarus climavarus is offline
I do stuff with robots sometimes
AKA: Steinley
FRC #4593 (Rapid Acceleration)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Rapid City
Posts: 3
climavarus is an unknown quantity at this point
New to Python: wpilib doesn't exist.

When trying to deploy my code to the robot, I get the error saying:
"ImportError: No module named 'wpilib'".

Our programming team this year is new to python, and we have no idea as to how to make this work. Running last years' code works fine, despite also having the library imported. Any ideas as to why this is happening?
Reply With Quote
  #2   Spotlight this post!  
Unread 26-01-2016, 22:18
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,043
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: New to Python: wpilib doesn't exist.

Quote:
Originally Posted by climavarus View Post
When trying to deploy my code to the robot, I get the error saying:
"ImportError: No module named 'wpilib'".

Our programming team this year is new to python, and we have no idea as to how to make this work. Running last years' code works fine, despite also having the library imported. Any ideas as to why this is happening?
Where is the error happening? Any other output that you might see could be helpful here.

How are you trying to deploy code to the robot?

Do you have pyfrc installed on the computer that you're trying to deploy to the robot? What version (you should be using a 2016 version)? If you're on Windows, you can find out by doing this on the command line to see what packages you have installed:

Code:
py -3 -m pip list
Or on linux/OSX:

Code:
pip3 list
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Reply With Quote
  #3   Spotlight this post!  
Unread 27-01-2016, 09:40
climavarus's Avatar
climavarus climavarus is offline
I do stuff with robots sometimes
AKA: Steinley
FRC #4593 (Rapid Acceleration)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Rapid City
Posts: 3
climavarus is an unknown quantity at this point
Re: New to Python: wpilib doesn't exist.

Man, you just made me realize what the issue is, I overlooked it in my frustration. We completely forgot to install pyfrc, and we hadn't done it yet because we've been having issues with pip as well. I don't remember what errors we were getting, but I'll give that another go.

But to answer your questions:

It's happening at the top of the code, and stops when it can't import wpilib. That's about all the output we're getting, just a couple lines of error message.

We're deploying code through the code's directory with
Code:
py robot.py deploy
.

So, we should be able to get this fixed now. Hopefully, my personal computer will be more forgiving than the teams programming computer so that I can figure this out.
Reply With Quote
  #4   Spotlight this post!  
Unread 27-01-2016, 09:47
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,043
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: New to Python: wpilib doesn't exist.

Quote:
Originally Posted by climavarus View Post
Man, you just made me realize what the issue is, I overlooked it in my frustration. We completely forgot to install pyfrc, and we hadn't done it yet because we've been having issues with pip as well.
If you don't use python for things other than robotpy, I would recommend just uninstalling your old version of python (and ensuring that C:\Python34 is deleted) and installing Python 3.5. It comes with pip, and should work out of the box.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Reply With Quote
  #5   Spotlight this post!  
Unread 27-01-2016, 13:56
climavarus's Avatar
climavarus climavarus is offline
I do stuff with robots sometimes
AKA: Steinley
FRC #4593 (Rapid Acceleration)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Rapid City
Posts: 3
climavarus is an unknown quantity at this point
Re: New to Python: wpilib doesn't exist.

That should solve our problem entirely, thanks for the help!
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 06:24.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi