Compiling probekins Reloaded

More
17 Feb 2014 22:40 #43916 by clunc
I am trying to finish a proper Probekins install. (Thank you, Michael Haberler, whom I hope my webstigation is properly attributing.)

My qualifications are that "I have a great project that cannot be done without it," but beyond that, I'm not a professional compiler, git-wiz, or py-hack.

I have two problems remaining--after punting and downloading alan_3301's did-it-for-you compilations from here . (Thank you, Alan!) (I didn't have much hope for these until Another Kind Reader observed that they would probably work since, necessarily, most of us have installed LinuxCNC cum EMC2 from the same Ubu ISO, and the lion's share work.)

My two remaining problems are:
1. stlvis.py's complaint about "'module' object has no attribute 'tricontourf'", related to an outdated matplotlib package in Ubuntu10.04.
2. my failure to recreate Alan's compile step with the 'comp' command necessary to execute 'sudo comp --install probekins' (which led to the punt).

Alan's probe2stl.py, stlcorr.py work for me, and generally the instructions for configuring LinuxCNC to install and use probekins from here also work. I have successfully created an STL from a set of probe points from an uneven surface, but I would like to visualize it with stlvis.py before turning it loose on the machine.

My obstacles relating to the two problems are:
2. I can't do the 'comp' because my LinuxCNC install does not have a 'comp' command (although it's mentioned here ). 'sudo which comp' returns nil.
1. I can't do an "easy_install" of a new matplotlib, because my LinuxCNC install does not report a package named 'easy_install' being available.

Re: 2, following alan_3301's Original Fine Thread here , informed me that I needed to:
$ sudo comp --install probekins
after fetching the probekins components from here . But my system has no 'comp'.

Re: 1, interestingly stlvis.py was not on the list of fetchable items from that location when I visited, but I later found it, along with another reference voronoi.py here . [Hint: click the link on the Probekins page and not in these forum posts, which may point to older versions by the time you read this?]

Looking at the stlvis.py code, as Alan did, I can see the 'pp' referenced in the error arises from matplotlib, but instructions from Probekins say to sudo apt-get easy_install.

My system:
$ uname -a
Linux santomaso 2.6.32-122-rtai #rtai SMP Tue Jul 27 12:44:07 CDT 2010 i686 GNU/Linux

says:
$ sudo apt-get install easy_install
E: Couldn't find package easy_install

That might be from a missing apt-source, but... help?

Thank you.

Please Log in or Create an account to join the conversation.

More
17 Feb 2014 23:44 #43917 by dgarrett
the comp utility is part of the package named: linuxcnc-dev
(sudo apt-get install linuxcnc-dev)

google says easy_install is in the package named: python-setuptools
(sudo apt-get install python-setuptools)
The following user(s) said Thank You: clunc

Please Log in or Create an account to join the conversation.

More
18 Feb 2014 08:36 #43931 by clunc
Replied by clunc on topic Compiling probekins Reloaded
> google says...

... and now linuxcnc.org does too! :)

Thanks, dgarrett, I'd pretty much googled all around it.

$ sudo easy_install matplotlib

is proceeding, but taking its sweet time.

$ sudo comp --install probekins

is complaining: "Unrecognized file type for mode install: 'probekins'"

although I ran it in the same dir with probekins.c and probekins.h.

Please Log in or Create an account to join the conversation.

More
18 Feb 2014 17:20 - 18 Feb 2014 23:23 #43940 by ArcEye
Replied by ArcEye on topic Compiling probekins Reloaded

$ sudo comp --install probekins
is complaining: "Unrecognized file type for mode install: 'probekins'"
although I ran it in the same dir with probekins.c and probekins.h.


If in doubt with linux, run commandname --help or -h

There is no file called probekins, so comp cannot compile and install it.

You want to compile the .c file, so the command is sudo comp --install probekins.c

I have just compiled it and it builds fine

regards
Last edit: 18 Feb 2014 23:23 by ArcEye.

Please Log in or Create an account to join the conversation.

More
18 Feb 2014 22:09 #43949 by clunc
Replied by clunc on topic Compiling probekins Reloaded
Thanks, ArcEye.

I am very sorry all; I have no explanation for misreading the instruction:
$ sudo comp --install probekins.c
I did type it in, over and over, expecting a different result, if that helps. (Didn't think so.)

Typing it, as-directed, resulted in SUCCESS! (To later readers, comp reported a couple of "warnings" about "mixed declarations and code" and about an undefined "__divdi3", but the desired module is in fact created anyway. NOTE: don't look for it in the same directory with probekins.c; on success it's put into /usr/realtime-2.6.32-122-rtai/modules/linuxcnc/.)

One DOWN. One to go.

I fear now to report that stlvis.py does not yet work, although the easy_install worked and finished with no errors. Before performing that step, I ran:
$ sudo dpkg --get-selections | grep matplotlib # to identify installed matplotlib packages
$ sudo apt-get remove <packages_found>
$ ./stlvis.py -h
Traceback (most recent call last):
  File "./stlvis.py", line 7, in <module>
    import matplotlib.pyplot as pp
ImportError: No module named matplotlib.pyplot

The easy_install seemed to "choose" a version of matplotlib (1.3.1, and as the error has changed, I wonder if it chose the one necessary for stlvis.py. However, before I could investigate that, it had me wreck my 'easy_install' installation...
~/linuxcnc/kinematics$ sudo easy_install matplotlib
Searching for matplotlib
Reading http://pypi.python.org/simple/matplotlib/
Reading http://matplotlib.org
Reading http://matplotlib.sourceforge.net
Reading http://sourceforge.net/project/showfiles.php?group_id=80706
Reading http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474
Reading http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.0/
Reading http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.1/
Reading https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=278194
Reading https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474
Reading https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.1/
Reading https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.3/
Reading https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0
Reading https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0.1/
Best match: matplotlib 1.3.1
Downloading https://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.3.1/matplotlib-1.3.1.tar.gz
Processing matplotlib-1.3.1.tar.gz
Running matplotlib-1.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-YYebrO/matplotlib-1.3.1/egg-dist-tmp-YVK2S_
The required version of distribute (>=0.6.28) is not available,
and can't be installed while this script is running. Please
install a more recent version first, using
'easy_install -U distribute'.

I did as directed:
$ sudo easy_install -U distribute
and now
$ sudo easy_install matplotlib
dumps:
~/linuxcnc/kinematics$ sudo easy_install matplotlib
Traceback (most recent call last):
  File "/usr/local/bin/easy_install", line 9, in <module>
    load_entry_point('distribute', 'console_scripts', 'easy_install')()
  File "/usr/local/lib/python2.6/dist-packages/setuptools-2.2-py2.6.egg/pkg_resources.py", line 353, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.6/dist-packages/setuptools-2.2-py2.6.egg/pkg_resources.py", line 2320, in load_entry_point
    raise ImportError("Entry point %r not found" % ((group,name),))
ImportError: Entry point ('console_scripts', 'easy_install') not found

In fact, so does a simple:
$ sudo easy_install

I'll apt-get remove/install the python-setuptools package to see if I can get past this. (I did not recall seeing a reference to "-U distribute" in earlier tries, but as the world now knows, I don't always read carefully...)

Please Log in or Create an account to join the conversation.

More
18 Feb 2014 22:33 #43951 by clunc
Replied by clunc on topic Compiling probekins Reloaded
No luck on re-apt-getting python-setuptools: easy_install still seems broken by "distribute" whatever that is.

Hoping to "back out" of the "distribute" install without using "easy_install" (but not knowing how to go about it for removal anyway), I scrolled back up to where it had been installed:
~/linuxcnc/kinematics$ sudo easy_install -U distribute
Searching for distribute
Reading http://pypi.python.org/simple/distribute/
Best match: distribute 0.7.3
Downloading https://pypi.python.org/packages/source/d/distribute/distribute-0.7.3.zip#md5=c6c59594a7b180af57af8a0cc0cf5b4a
Processing distribute-0.7.3.zip
Running distribute-0.7.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-BcZBEA/distribute-0.7.3/egg-dist-tmp-371xun
warning: install_lib: 'build/lib.linux-i686-2.6' does not exist -- no Python modules to install
Adding distribute 0.7.3 to easy-install.pth file

Installed /usr/local/lib/python2.6/dist-packages/distribute-0.7.3-py2.6.egg
Processing dependencies for distribute
Searching for setuptools>=0.7
Reading http://pypi.python.org/simple/setuptools/
Reading http://peak.telecommunity.com/snapshots/
Reading https://pypi.python.org/pypi/setuptools
Best match: setuptools 2.2
Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-2.2.tar.gz#md5=04a7664538957b832710653fd7d5b4e6
Processing setuptools-2.2.tar.gz
Running setuptools-2.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-iRZJaJ/setuptools-2.2/egg-dist-tmp-Du0_Vj
Adding setuptools 2.2 to easy-install.pth file
Installing easy_install script to /usr/local/bin
Installing easy_install-2.6 script to /usr/local/bin

Installed /usr/local/lib/python2.6/dist-packages/setuptools-2.2-py2.6.egg
Finished processing dependencies for distribute

$ sudo easy_install -U distribute
appears to have replaced a previous version (<0.6.28) with 0.7.3 (and broken easy_install itself)

which I'd like to back out of (and must use something besides easy_install to do), but
$ sudo dpkg --get-selections | grep "distri"
returns nil.

Thank you.

Please Log in or Create an account to join the conversation.

More
18 Feb 2014 23:44 #43952 by ArcEye
Replied by ArcEye on topic Compiling probekins Reloaded
Hi

I did as directed:
$ sudo easy_install -U distribute
and now
$ sudo easy_install matplotlib


I don't know anything about easy_install, but I cannot see where you are getting your instructions from.

The steps in the wiki are

$ sudo apt-get remove python-matplotlib
$ sudo apt-get install easy_install
$ sudo easy_install matplotlib


This is to remove the old copy of python-matplotlib, install something which will fetch more recent python libraries and then install a more recent version of python-matplotlib

Nothing about easy_install -U distribute

Distribute itself appaears to be a fork of the setuptools project, so appears to be a replacement for easy_install not an adjunct to it

I can only suggest that you remove what you added and start again.
The trouble with using 2 different package managers on one system is that apt is unaware of what easy_install has done and vice versa, so you need to remove each package with the manager that installed it,
until you are back at your start point again.

It is quite easy to screw up everything, when dependencies were required for one package but are also required by another one the manager is unaware of, or conflict with an existing package.

Good Luck :(

Please Log in or Create an account to join the conversation.

More
19 Feb 2014 22:31 #43976 by clunc
Replied by clunc on topic Compiling probekins Reloaded
ArcEye,

Thank you for sane advice.

Sparing you a dreary read:
I'd like to try the matplotlib version previous to 1.3.1 and install it manuallly if possible.

It was easy_install itself which instructed the step:
$ sudo easy_install -U distribute
having refused to do
$ sudo easy_install matplotlib
without it.

I've now done:
$ sudo apt-get remove python-setuptools # no more easy_install
$ sudo apt-get remove matplotlib # reports not present anyway
$ which easy_install
/usr/local/bin/easy_install # huh?!

Turns out there are still two (easy_install[-2.6]) "easy_installs" in /usr/local/bin/, both scripts, and both failing with errors about missing entrypoints. Dff'ing them brings up info about my little friend 'distribute'. (Turns out distribute's not evil; it's in easy_install from the get-go, but somehow the version freaked.)
$ sudo rm /usr/local/bin/easy_install* # I don't think I should have to do this, but w/o it, but they are not overwritten by apt-get install...

Weirder and weirder however.
$ sudo apt-get install python-setuptools # as before, but
$ which easy_install
/usr/bin/easy_install # what? What?!
$ diff /usr/bin/easy_install* # still shows 'distribute' is a key component

But THIS easy_install works.
$ easy_install
and provides this reference, for any future reader who has not succumbed on this quest:
peak.telecommunity.com/EasyInstall.html
as well as the information that the default directory for installs is:
/usr/local/lib/python2.6/dist-packages/

Now ready for The Acid Test:
$ sudo easy_install matplotlib # same as before, sifts through a number of sites and picks "Best match: matplotlib 1.3.1"
$ ~/linuxcnc/kinematics/stlvis.py
$ ./stlvis.py
Disappointment: "No module named matplotlib.pyplot."
Traceback (most recent call last):
  File "./stlvis.py", line 7, in <module>
    import matplotlib.pyplot as pp
ImportError: No module named matplotlib.pyplot

However, I still have the list of sites easy_install contacted before picking v1.3.1 in the console:
Reading http://pypi.python.org/simple/matplotlib/
Reading http://matplotlib.org
Reading http://matplotlib.sourceforge.net
Reading http://sourceforge.net/project/showfiles.php?group_id=80706
Reading http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474
Reading http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.0/
Reading http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.1/
Reading https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=278194
Reading https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474
Reading https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.1/
Reading https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.3/
Reading https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0
Reading https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0.1/

I visited the first one (and the one which offered 1.3.1) and found a list of all the versions.

I'd like to try the version previous to 1.3.1 and install it mamnuallly if possible.

Please Log in or Create an account to join the conversation.

More
19 Feb 2014 23:07 #43979 by ArcEye
Replied by ArcEye on topic Compiling probekins Reloaded

I'd like to try the version previous to 1.3.1 and install it mamnuallly if possible.


You don't need to, as this page clearly shows, pyplot is in 1.3.1 and an integral part of it.
matplotlib.org/1.3.1/users/pyplot_tutorial.html

I would suspect that your paths are not right and the lib is not being found.

Please Log in or Create an account to join the conversation.

More
20 Feb 2014 21:17 #44008 by clunc
Replied by clunc on topic Compiling probekins Reloaded
Thank you for that. I was dreading it even as I contemplated it.

I read it as having to do with Python configuration which I'll look into.

Please Log in or Create an account to join the conversation.

Time to create page: 0.193 seconds
Powered by Kunena Forum