soft-matter / trackpy-examples

sample images, examples, and speed tests for trackpy
Other
21 stars 42 forks source link

tp.batch does not work #11

Closed kedmond closed 9 years ago

kedmond commented 9 years ago

Hey guys, I'm trying to complete your walkthrough on some of my own images. The locate function works just fine on an individual frame. But if I feed multiple frames to the batch function I get the following:

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "trackpy\feature.py", line 684, in batch trackpy_version=trackpy.__version__, AttributeError: 'module' object has no attribute '__version__'

I'm not sure what to do. Thanks!

-Kazem

danielballan commented 9 years ago

Background: When you run batch, trackpy generates a text file (a YAML file, technically) recording all the pertinent information you would need to recreate that same batch later. It includes the version of trackpy that was used.

From that error, it seems that something didn't quite work during the trackpy installation; the installation does not seem to know which version it is. How did you install trackpy? You could try uninstalling trackpy and installing it with conda, which should definitely not have this problem. We only recently started recommending a conda-based installation.

kedmond commented 9 years ago

Install it? Ha, I just cloned the GitHub repository, cd into the directory, and import it that way. So I definitely didn't install it properly I guess. Sorry! I'll look up this Conda. Unfortunately I'm on a Windows computer. Thanks for the help!

On Fri Nov 07 2014 at 16:03:57 Dan Allan notifications@github.com wrote:

Background: When you run batch, trackpy generates a text file (a YAML file, technically) recording all the pertinent information you would need to recreate that same batch later. It includes the version of trackpy that was used.

From that error, it seems that something didn't quite work during the trackpy installation; the installation does not seem to know which version it is. How did you install trackpy? You could try uninstalling trackpy and installing it with conda https://github.com/soft-matter/trackpy#installation, which should definitely not have this problem. We only recently started recommending a conda-based installation.

— Reply to this email directly or view it on GitHub https://github.com/soft-matter/trackpy-examples/issues/11#issuecomment-62166574 .

danielballan commented 9 years ago

Installing from source on Windows is fine, but as with all python packages you have to install it. I usually:

git clone ...
cd name-of-project
python setup.py develop

On Fri Nov 07 2014 at 11:05:55 AM Kazem Edmond notifications@github.com wrote:

Install it? Ha, I just cloned the GitHub repository, cd into the directory, and import it that way. So I definitely didn't install it properly I guess. Sorry! I'll look up this Conda. Unfortunately I'm on a Windows computer. Thanks for the help!

On Fri Nov 07 2014 at 16:03:57 Dan Allan notifications@github.com wrote:

Background: When you run batch, trackpy generates a text file (a YAML file, technically) recording all the pertinent information you would need to recreate that same batch later. It includes the version of trackpy that was used.

From that error, it seems that something didn't quite work during the trackpy installation; the installation does not seem to know which version it is. How did you install trackpy? You could try uninstalling trackpy and installing it with conda https://github.com/soft-matter/trackpy#installation, which should definitely not have this problem. We only recently started recommending a conda-based installation.

— Reply to this email directly or view it on GitHub https://github.com/soft-matter/trackpy-examples/issues/11#issuecomment- 62166574 .

— Reply to this email directly or view it on GitHub https://github.com/soft-matter/trackpy-examples/issues/11#issuecomment-62166895 .

kedmond commented 9 years ago

Oh! I didn't do the setup. thanks!

On Fri Nov 07 2014 at 16:39:28 Dan Allan notifications@github.com wrote:

Installing from source on Windows is fine, but as with all python packages you have to install it. I usually:

git clone ... cd name-of-project python setup.py develop

On Fri Nov 07 2014 at 11:05:55 AM Kazem Edmond notifications@github.com wrote:

Install it? Ha, I just cloned the GitHub repository, cd into the directory, and import it that way. So I definitely didn't install it properly I guess. Sorry! I'll look up this Conda. Unfortunately I'm on a Windows computer. Thanks for the help!

On Fri Nov 07 2014 at 16:03:57 Dan Allan notifications@github.com wrote:

Background: When you run batch, trackpy generates a text file (a YAML file, technically) recording all the pertinent information you would need to recreate that same batch later. It includes the version of trackpy that was used.

From that error, it seems that something didn't quite work during the trackpy installation; the installation does not seem to know which version it is. How did you install trackpy? You could try uninstalling trackpy and installing it with conda https://github.com/soft-matter/trackpy#installation, which should definitely not have this problem. We only recently started recommending a conda-based installation.

— Reply to this email directly or view it on GitHub < https://github.com/soft-matter/trackpy-examples/issues/11#issuecomment- 62166574> .

— Reply to this email directly or view it on GitHub < https://github.com/soft-matter/trackpy-examples/issues/11#issuecomment-62166895>

.

— Reply to this email directly or view it on GitHub https://github.com/soft-matter/trackpy-examples/issues/11#issuecomment-62172269 .

tacaswell commented 9 years ago

It is best to not run anything in the source directory. The imports can grow very confused.

kedmond commented 9 years ago

Hey Tim, yeah, I am running it from another directory, but with no luck. I ran setup.py just now from the Windows terminal, and it installed everything fine until it says "Unable to find vcvarsall.bat" which is from Virtual Studio...which I don't have installed. Do I need to install that?

People talk about it here: http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat

danielballan commented 9 years ago

That's a generic error that means, "This package or one of its dependencies needs a C compiler, and you don't have the right C compiler set up." It's a notorious issue on Windows, and rather than dig into it, I suggest you use conda to get around it. Get conda, as per our README, and install trackpy:

conda install -c soft-matter trackpy

This will get you trackpy and, moreover, all of its dependencies -- already compiled and ready to go. This is why conda is great. Then, if you want to, you can supercede that installation of trackpy with your own installed-from-source copy:

conda remove trackpy  # note: its dependencies will not be removed
cd trackpy
python setup.py develop

Trackpy itself does not need a C compiler, so this should work fine. Developing on Windows can be rough, but conda makes it doable and way easier than it was just a couple years ago.

On Fri Nov 07 2014 at 12:01:07 PM Kazem Edmond notifications@github.com wrote:

Hey Tim, yeah, I am running it from another directory, but with no luck. I ran setup.py just now from the Windows terminal, and it installed everything fine until it says "Unable to find vcvarsall.bat" which is from Virtual Studio...which I don't have installed. Do I need to install that?

People talk about it here: http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat

— Reply to this email directly or view it on GitHub https://github.com/soft-matter/trackpy-examples/issues/11#issuecomment-62175719 .

kedmond commented 9 years ago

You are a star. I just used conda. Thanks again.

-Kazem

On Fri Nov 07 2014 at 17:08:43 Dan Allan notifications@github.com wrote:

That's a generic error that means, "This package or one of its dependencies needs a C compiler, and you don't have the right C compiler set up." It's a notorious issue on Windows, and rather than dig into it, I suggest you use conda to get around it. Get conda, as per our README, and install trackpy:

conda install -c soft-matter trackpy

This will get you trackpy and, moreover, all of its dependencies -- already compiled and ready to go. This is why conda is great. Then, if you want to, you can supercede that installation of trackpy with your own installed-from-source copy:

conda remove trackpy # note: its dependencies will not be removed cd trackpy python setup.py develop

Trackpy itself does not need a C compiler, so this should work fine. Developing on Windows can be rough, but conda makes it doable and way easier than it was just a couple years ago.

On Fri Nov 07 2014 at 12:01:07 PM Kazem Edmond notifications@github.com wrote:

Hey Tim, yeah, I am running it from another directory, but with no luck. I ran setup.py just now from the Windows terminal, and it installed everything fine until it says "Unable to find vcvarsall.bat" which is from Virtual Studio...which I don't have installed. Do I need to install that?

People talk about it here:

http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat

— Reply to this email directly or view it on GitHub < https://github.com/soft-matter/trackpy-examples/issues/11#issuecomment-62175719>

.

— Reply to this email directly or view it on GitHub https://github.com/soft-matter/trackpy-examples/issues/11#issuecomment-62176824 .

kedmond commented 9 years ago

Dan, After following your tutorial, it all installed correctly. I'd be using Linux, but my work is happier if I used Windows.

Anyway, I got batch to work, but it spits out a ton of errors into

Python's internal console. I think what I've done with my Python installation is weird though. I have Python(x,y) installed. And then I installed conda and did as you said. So I think there might be two conflicting Python's installed. Maybe I'm wrong. I guess I want Conda to be in charge of my Python installation, but I really like using Spyder.

Any thoughts? Thanks again.

-Kazem

On Fri Nov 07 2014 at 17:09:49 Kazem Edmond kedmond@gmail.com wrote:

You are a star. I just used conda. Thanks again.

-Kazem

On Fri Nov 07 2014 at 17:08:43 Dan Allan notifications@github.com wrote:

That's a generic error that means, "This package or one of its dependencies needs a C compiler, and you don't have the right C compiler set up." It's a notorious issue on Windows, and rather than dig into it, I suggest you use conda to get around it. Get conda, as per our README, and install trackpy:

conda install -c soft-matter trackpy

This will get you trackpy and, moreover, all of its dependencies -- already compiled and ready to go. This is why conda is great. Then, if you want to, you can supercede that installation of trackpy with your own installed-from-source copy:

conda remove trackpy # note: its dependencies will not be removed cd trackpy python setup.py develop

Trackpy itself does not need a C compiler, so this should work fine. Developing on Windows can be rough, but conda makes it doable and way easier than it was just a couple years ago.

On Fri Nov 07 2014 at 12:01:07 PM Kazem Edmond notifications@github.com

wrote:

Hey Tim, yeah, I am running it from another directory, but with no luck. I ran setup.py just now from the Windows terminal, and it installed everything fine until it says "Unable to find vcvarsall.bat" which is from Virtual Studio...which I don't have installed. Do I need to install that?

People talk about it here: http://stackoverflow.com/questions/2817869/error- unable-to-find-vcvarsall-bat

— Reply to this email directly or view it on GitHub https://github.com/soft-matter/trackpy-examples/ issues/11#issuecomment-62175719 .

— Reply to this email directly or view it on GitHub https://github.com/soft-matter/trackpy-examples/issues/11#issuecomment-62176824 .

danielballan commented 9 years ago

Is it spitting errors or warnings?

On Fri Nov 07 2014 at 12:19:34 PM Kazem Edmond notifications@github.com wrote:

Dan, After following your tutorial, it all installed correctly. I'd be using Linux, but my work is happier if I used Windows.

Anyway, I got batch to work, but it spits out a ton of errors into Python's internal console. I think what I've done with my Python installation is weird though. I have Python(x,y) installed. And then I installed conda and did as you said. So I think there might be two conflicting Python's installed. Maybe I'm wrong. I guess I want Conda to be in charge of my Python installation, but I really like using Spyder.

Any thoughts? Thanks again.

-Kazem

On Fri Nov 07 2014 at 17:09:49 Kazem Edmond kedmond@gmail.com wrote:

You are a star. I just used conda. Thanks again.

-Kazem

On Fri Nov 07 2014 at 17:08:43 Dan Allan notifications@github.com wrote:

That's a generic error that means, "This package or one of its dependencies needs a C compiler, and you don't have the right C compiler set up." It's a notorious issue on Windows, and rather than dig into it, I suggest you use conda to get around it. Get conda, as per our README, and install trackpy:

conda install -c soft-matter trackpy

This will get you trackpy and, moreover, all of its dependencies -- already compiled and ready to go. This is why conda is great. Then, if you want to, you can supercede that installation of trackpy with your own installed-from-source copy:

conda remove trackpy # note: its dependencies will not be removed cd trackpy python setup.py develop

Trackpy itself does not need a C compiler, so this should work fine. Developing on Windows can be rough, but conda makes it doable and way easier than it was just a couple years ago.

On Fri Nov 07 2014 at 12:01:07 PM Kazem Edmond < notifications@github.com>

wrote:

Hey Tim, yeah, I am running it from another directory, but with no luck. I ran setup.py just now from the Windows terminal, and it installed everything fine until it says "Unable to find vcvarsall.bat" which is from Virtual Studio...which I don't have installed. Do I need to install that?

People talk about it here: http://stackoverflow.com/questions/2817869/error- unable-to-find-vcvarsall-bat

— Reply to this email directly or view it on GitHub https://github.com/soft-matter/trackpy-examples/ issues/11#issuecomment-62175719 .

— Reply to this email directly or view it on GitHub < https://github.com/soft-matter/trackpy-examples/issues/11#issuecomment-62176824>

.

— Reply to this email directly or view it on GitHub https://github.com/soft-matter/trackpy-examples/issues/11#issuecomment-62178421 .

tacaswell commented 9 years ago

conda ships spyder

conda install spyder
tacaswell commented 9 years ago

which seems to have a secret dependency on jinja2 so you might also need conda install jinja2. Should probably tell them about that.

kedmond commented 9 years ago

Tom: Thanks! I swear, I'm not as clueless as this thread makes me seem. :-)

Should I do a full uninstall of PythonXY and start over with conda?

Dan: Here is what happens if I use batch on two frames of a stack.

>>> Traceback (most recent call last):
  File
"C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\baseshell.py",
line 274, in write_output
    self.shell.write(self.get_stdout(), flush=True)
  File "C:\Python27\lib\site-packages\spyderlib\widgets\shell.py", line
572, in write
    self.flush(error=error, prompt=prompt)
  File "C:\Python27\lib\site-packages\spyderlib\widgets\shell.py", line
583, in flush
    self.insert_text(text, at_end=True, error=error, prompt=prompt)
  File "C:\Python27\lib\site-packages\spyderlib\widgets\shell.py", line
598, in insert_text
    self.append_text_to_shell(text, error, prompt)
  File
"C:\Python27\lib\site-packages\spyderlib\widgets\sourcecode\base.py", line
1121, in append_text_to_shell
    for code in [int(_c) for _c in match.group(1).split(';')]:
ValueError: invalid literal for int() with base 10: '2K Fra'
Traceback (most recent call last):
  File
"C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\baseshell.py",
line 274, in write_output
    self.shell.write(self.get_stdout(), flush=True)
  File "C:\Python27\lib\site-packages\spyderlib\widgets\shell.py", line
572, in write
    self.flush(error=error, prompt=prompt)
  File "C:\Python27\lib\site-packages\spyderlib\widgets\shell.py", line
583, in flush
    self.insert_text(text, at_end=True, error=error, prompt=prompt)
  File "C:\Python27\lib\site-packages\spyderlib\widgets\shell.py", line
598, in insert_text
    self.append_text_to_shell(text, error, prompt)
  File
"C:\Python27\lib\site-packages\spyderlib\widgets\sourcecode\base.py", line
1121, in append_text_to_shell
    for code in [int(_c) for _c in match.group(1).split(';')]:
ValueError: invalid literal for int() with base 10: '2K Fra'

>>>

So it's spitting out the same set of errors for each frame. However, it is working, and finding the coordinates.

-Kazem

On Fri Nov 07 2014 at 17:22:14 Thomas A Caswell notifications@github.com wrote:

conda ships spyder

conda install spyder

— Reply to this email directly or view it on GitHub https://github.com/soft-matter/trackpy-examples/issues/11#issuecomment-62178773 .

tacaswell commented 9 years ago

see https://github.com/ContinuumIO/anaconda-issues/issues/201

And yes, I would suggest sticking with just one distribution method or you will end up in path-hell where half your imports are from one python, half from another and get segfaults due to ABI incompatibilities.

tacaswell commented 9 years ago

And those are errors coming out of spyder which is odd.

tacaswell commented 9 years ago

http://docs.continuum.io/anaconda/ <-- see known spyder issues at the bottom

kedmond commented 9 years ago

I just ran all of my commands in the windows terminal, and it works with no troubles. I think my troubles are related to these conflicting Pythons. There are too many snakes on this plane: https://www.youtube.com/watch?v=PZ2QFmJ7h0A

I'll work on this now...

-Kazem

On Fri Nov 07 2014 at 17:30:02 Thomas A Caswell notifications@github.com wrote:

see ContinuumIO/anaconda-issues#201 https://github.com/ContinuumIO/anaconda-issues/issues/201

And yes, I would suggest sticking with just one distribution method or you will end up in path-hell where half your imports are from one python, half from another and get segfaults due to ABI incompatibilities.

— Reply to this email directly or view it on GitHub https://github.com/soft-matter/trackpy-examples/issues/11#issuecomment-62180979 .

kedmond commented 9 years ago

Wow, that's mental.

I'm uninstalling Pythonxy and going to try to start over with Conda...hope it works. On Fri Nov 07 2014 at 17:33:14 Kazem Edmond kedmond@gmail.com wrote:

I just ran all of my commands in the windows terminal, and it works with no troubles. I think my troubles are related to these conflicting Pythons. There are too many snakes on this plane: https://www.youtube.com/watch?v=PZ2QFmJ7h0A

I'll work on this now...

-Kazem

On Fri Nov 07 2014 at 17:30:02 Thomas A Caswell notifications@github.com wrote:

see ContinuumIO/anaconda-issues#201 https://github.com/ContinuumIO/anaconda-issues/issues/201

And yes, I would suggest sticking with just one distribution method or you will end up in path-hell where half your imports are from one python, half from another and get segfaults due to ABI incompatibilities.

— Reply to this email directly or view it on GitHub https://github.com/soft-matter/trackpy-examples/issues/11#issuecomment-62180979 .

kedmond commented 9 years ago

Hey guys, after removing PythonXY and using conda for everything, it all works really well.

However, I liked how PythonXY setup Spyder...so I'll have to figure that out. But yes, everything is working far better this way. I wish I'd followed the tutorial to begin with! Sorry.

-Kazem

On Fri Nov 07 2014 at 17:36:00 Kazem Edmond kedmond@gmail.com wrote:

Wow, that's mental.

I'm uninstalling Pythonxy and going to try to start over with Conda...hope it works. On Fri Nov 07 2014 at 17:33:14 Kazem Edmond kedmond@gmail.com wrote:

I just ran all of my commands in the windows terminal, and it works with no troubles. I think my troubles are related to these conflicting Pythons. There are too many snakes on this plane: https://www.youtube. com/watch?v=PZ2QFmJ7h0A

I'll work on this now...

-Kazem

On Fri Nov 07 2014 at 17:30:02 Thomas A Caswell notifications@github.com wrote:

see ContinuumIO/anaconda-issues#201 https://github.com/ContinuumIO/anaconda-issues/issues/201

And yes, I would suggest sticking with just one distribution method or you will end up in path-hell where half your imports are from one python, half from another and get segfaults due to ABI incompatibilities.

— Reply to this email directly or view it on GitHub https://github.com/soft-matter/trackpy-examples/issues/11#issuecomment-62180979 .

tacaswell commented 9 years ago

cc @ccordoba12 regarding the spyder issues up thread a bit.

kedmond commented 9 years ago

Will do! Thanks.

On Fri, 7 Nov 2014 18:39 Thomas A Caswell notifications@github.com wrote:

cc @ccordoba12 https://github.com/ccordoba12 regarding the spyder issues up thread a bit.

— Reply to this email directly or view it on GitHub https://github.com/soft-matter/trackpy-examples/issues/11#issuecomment-62191427 .

ccordoba12 commented 9 years ago

Thanks for the ping @tacaswell. I'll take a look at this one next week.