问题
I'm trying to use the Vimeo API. In the documentation here it simply says to use pip install PyVimeo
and it will install.
Unfortunately that doesn't work for me.
What I'm trying to accomplish is to be able to use the API to upload a bunch of videos to my PRO account.
I've tried their support and they were not terribly helpful.
Here's what I tried so far...
Originally I tried in Anaconda with Python 3, the package tries to install and then ends with Command "python setup.py egg_info" failed with error code 10 in C:\Users\Drew\AppData\Local\Temp\pip-install-y0bim5p8\pycurl\
Per Vimeo's recommendation I've uninstalled and reinstalled pycurl in my Anaconda environment but with the same result.
I used Google and found this article where people say they've been able to work around the issue here: https://github.com/vimeo/vimeo.py/issues/129
The punchline in the article was it fails if you try to download and install it at the same time, but if you download it and then install it locally it should work.
Using Google some more I found this question on SO, so I tried it out.
I did download the package locally and installed it using pip but it was all in Python 2 and used outdated libraries that Anaconda didn't seem able to automatically handle (my guess is because of a local pip install) and I tried to dig into the local files and update the code error message by error message to Python 3 compatibility, but this is really pushing my skill set - I was surprised how many I was able to work through, but ultimately I hit a dead on what I could figure out.
Trying to problem solve I switched my Anaconda to Python 2.7 and I was able to do pip install PyVimeo
and to my surprise it was able to download the packages....
But then I tried to run the simplest of scripts:
import vimeo
print('Your video test is done')
I get this error: 'ModuleNotFoundError: No module named 'Vimeo'
Which baffles me because I'm not using 'Vimeo
' but rather 'vimeo
' and when in look in the 'Anaconda3\envs\py2\Lib\site-packages\vimeo
' folder and then in all the .py
files I see no calls to a module called 'Vimeo
.'
And when it's all said and done I'm ~8 hours into this. I'm not that great of a programmer but I'm also stubborn and hate giving up.... does anyone have any ideas or suggestions on how I can get this to work?
Thank you in advance!
回答1:
I had the same problem a few days ago. the problem is in the requirements of the pycurl version in the PYVimeo package, which is not compatible with python3, I solved this by installing PyVimeo without dependencies. pip install PyVimeo --no-dependencies
and later installing the dependencies in its latest version pip install pycurl (if this not work, download the whl here: https://www.lfd.uci.edu/~gohlke/pythonlibs/) pip install pycurl pip install tuspy pip install requests
回答2:
Somehow I got this working and at the risk of being down-voted I'll share my answer in case it helps someone in the future.
The basic steps were the following:
- Reboot (I got it working after I did this.)
- Activate an Anaconda Python 2.7 environment, in my case I called it 'py2' (at the time of writing
PyVimeo
only supports 2.7) - Manually copy the
vimeo.py-1.0.7.tar.gz
file to your environment folder located here:{Your file path}\Anaconda3\envs\{Your environment name}\Lib
- Critical Step Not Documented --> Use
pip install vimeo.py-1.0.7.tar.gz --ignore-installed
Step 4 was the cause of heartburn, without the --ignore-installed
Anaconda kept getting stuck and I was chasing my tail trying to install and uninstall all kinds of packages that were really utilities that Anaconda wouldn't let me uninstall.
In hindsight I see that Vimeo portrays themselves as cutting edge or at least up with the times on their site, I was not expecting their API to be based of Python 2.7.
That alone probably cost me at least 4 hours of burned time trying to figure this out. Even as a relative newbie I've been using Python 3 for over three years so it didn't occur to me they might be a lower version (lesson learned on my part.)
Also, the --ignore-installed
to get around the problem was something new to me as well. That probably would have saved me about 2 hours.
Hopefully this helps someone. I'm certainly no expert on packages, dependencies, etc but this was enough 'fun' for me to know I'm thankful for how much of it Anaconda handles for me.
来源:https://stackoverflow.com/questions/54722116/use-pyvimeo-from-anaconda