Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not upgrade youtube-dl on ubuntu #4819

Closed
deng-kai opened this issue Jan 30, 2015 · 2 comments
Closed

can not upgrade youtube-dl on ubuntu #4819

deng-kai opened this issue Jan 30, 2015 · 2 comments

Comments

@deng-kai
Copy link

@deng-kai deng-kai commented Jan 30, 2015

I use this command on my ubuntu 14.04 desktop:
sudo -H pip install --upgrade youtube_dl
then this is the result:
Collecting youtube-dl from https://pypi.python.org/packages/2.7/y/youtube_dl/youtube_dl-2015.01.23.4-py2.py3-none-any.whl#md5=88cab49c1d9667a4cacff354376b8d62
Using cached youtube_dl-2015.01.23.4-py2.py3-none-any.whl
Installing collected packages: youtube-dl
Found existing installation: youtube-dl 2015.1.15
Can't uninstall 'youtube-dl'. No files were found to uninstall.
Successfully installed youtube-dl-2015.1.15

the pip log:
Can't roll back youtube-dl; was not uninstalled
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 232, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 549, in install
**kwargs
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 751, in install
self.move_wheel_files(self.source_dir, root=root)
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 960, in move_wheel_files
isolated=self.isolated,
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 234, in move_wheel_files
clobber(source, lib_dir, True)
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 212, in clobber
shutil.copyfile(srcfile, destfile)
File "/usr/lib/python2.7/shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/youtube_dl/utils.py'
File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 347, in run
root=options.root_path,

/usr/local/lib/python2.7/dist-packages/youtube_dl$ ls
aes.py downloader main.py swfinterp.pyc version.pyc
aes.pyc extractor main.pyc update.py YoutubeDL.py
cache.py init.py options.py update.pyc YoutubeDL.pyc
cache.pyc init.pyc options.pyc utils.py
compat.py jsinterp.py postprocessor utils.pyc
compat.pyc jsinterp.pyc swfinterp.py version.py

command
whereis youtube-dl : /usr/local/bin/youtube-dl

@phihag
Copy link
Contributor

@phihag phihag commented Jan 30, 2015

How did you install youtube-dl previously?

And are you sure that the log and command match? What is the output of

sudo touch /usr/local/lib/python2.7/dist-packages/youtube_dl/utils.py

? It is really strange that root should not have the necessary permissions.

Why did you pass in -H to sudo? That does not seem to be a good idea in the first place, although it may have been harmless here.

In any case, to get out of this mess, simply deleting and manually reinstalling should be sufficient:

sudo rm -rf /usr/local/share/doc/youtube_dl /usr/local/lib/python2.7/dist-packages/youtube_dl /usr/local/bin/youtube-dl
sudo pip install --upgrade youtube-dl

If it still fails after that, there may be a problem with pip. Have you tried our manual installation?

I'm closing this issue since I believe that any one of the proposed solutions should work. I'd very much appreciate a comment though, clearing up this mystery. If the issue persists, please say so and we will reopen it. Thank you very much for the report!

@phihag phihag closed this Jan 30, 2015
@deng-kai
Copy link
Author

@deng-kai deng-kai commented Jan 30, 2015

thank you, I solve it
But I have some information file in /usr/local/lib/python2.7/dist-packages/:

youtube_dl-2015.01.15.dist-info
youtube_dl-2015.01.23.4.dist-info
youtube_dl-2015.01.30.2.dist-info

so I do that:

sudo rm -rf /usr/local/share/doc/youtube_dl /usr/local/lib/python2.7/dist-packages/youtube_dl* /usr/local/bin/youtube-dl
sudo pip install --upgrade youtube-dl

then fix this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.