Python Forum
How to check if video has been deleted or removed in youtube using python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to check if video has been deleted or removed in youtube using python
#11
(Feb-17-2020, 01:37 AM)snippsat Wrote: You most first install a version and then set it as global.
Example if i want to use 3.8.1 on my Linux Mint 19.
...

Thanks, that nearly worked. At least Python 3.8.1 got installed

:~$ pyenv install 3.8.1
Downloading Python-3.8.1.tar.xz...
-> https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tar.xz
Installing Python-3.8.1...
Installed Python-3.8.1 to /home/********/.pyenv/versions/3.8.1

:~$ pyenv global 3.8.1
:~$ python
Python 2.7.12 (default, Oct  8 2019, 14:14:10) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> eit
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
>>> 
:~$ pip -V
pip 20.0.2 from /usr/local/lib/python3.5/dist-packages/pip (python 3.5)
:~$ python -V
Python 2.7.12
Reply
#12
Changing the interpreter system wide can result into unexpected bugs.
For example if there is a Python2-Only script on the system and incompatible to Python 3,
then it won't run. I'm not sure if all os-specific tools do have Python 3 support.
Better is, if you change your local environment.

pyenv global system
pyenv local 3.8.1
Then try again to run python.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#13
(Feb-17-2020, 07:16 AM)DeaD_EyE Wrote: Changing the interpreter system wide can result into unexpected bugs.
For example if there is a Python2-Only script on the system and incompatible to Python 3,
then it won't run. I'm not sure if all os-specific tools do have Python 3 support.
Better is, if you change your local environment.

pyenv global system
pyenv local 3.8.1
Then try again to run python.

Thanks, I did the following

:~$ pyenv global system
:~$ pyenv local 3.8.1
:~$ python
Python 2.7.12 (default, Oct  8 2019, 14:14:10) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
:~$ 
Possibly if I determine what python packages are dependant upon version 2.7.12, and remove those packages if they are not required ? Then uninstall python version 2.7.12. Sounds messy, I'm in the process if updating the OS, so will do that as a matter of course.
Reply
#14
I guess you've forgotten to add

export PATH="/home/public/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
to your ~/.bashrc

Before you do it, change the path: /home/public/.pyenv/
Your path is different.

You should also check your environment (shell, not Python):
env | egrep "SHELL|PYENV_SHELL|PYENV_VIRTUALENV_INIT|HOME|PATH"
Output:
SHELL=/bin/bash PYENV_SHELL=bash PYENV_VIRTUALENV_INIT=1 HOME=/home/public PATH=/home/public/.pyenv/plugins/pyenv-virtualenv/shims:/home/public/.pyenv/shims:/home/public/.pyenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
With the command which you can see the path of a program:
which python
In my case this is returned:
Output:
/home/public/.pyenv/shims/python
If you get a path to /usr/bin/python, then something with the PATH environment variable is not right.
Just check, if you have done the steps (adding code to .bashrc) to install pyenv.


PS: Python 3.8.2rc1 was released.
To get the new version of pyenv:
cd ~/.pyenv
git pull
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#15
(Feb-17-2020, 09:39 AM)DeaD_EyE Wrote: I guess you've forgotten to add

export PATH="/home/public/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
to your ~/.bashrc

I had added 2 of the 3 lines ?? Anyway, the third line is added now and I rebooted.

(Feb-17-2020, 09:39 AM)DeaD_EyE Wrote: You should also check your environment (shell, not Python):
env | egrep "SHELL|PYENV_SHELL|PYENV_VIRTUALENV_INIT|HOME|PATH"

Mine was ..

Output:
SHELL=/bin/bash SHELL_SESSION_ID=b1e4f28e8fc04000a3e6c7bcae119f97 XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1 XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0 DEFAULTS_PATH=/usr/share/gconf//usr/share/xsessions/plasma.default.path PATH=/home/********/.pyenv/shims:~/.pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin MANDATORY_PATH=/usr/share/gconf//usr/share/xsessions/plasma.mandatory.path PYENV_SHELL=bash HOME=/home/******** PROFILEHOME=
(Feb-17-2020, 09:39 AM)DeaD_EyE Wrote: With the command which you can see the path of a program:
which python

In my case this is returned:

Output:
/home/********/.pyenv/shims/python
(Feb-17-2020, 09:39 AM)DeaD_EyE Wrote: PS: Python 3.8.2rc1 was released.
To get the new version of pyenv:
cd ~/.pyenv
git pull

I tried that but it thinks 3.8.1 is the latest ?

:~$ cd ~/.pyenv
:~/.pyenv$ git pull
Already up-to-date.
:~/.pyenv$ python -V
Python 3.8.1
:~/.pyenv$ python
Python 3.8.1 (default, Feb 17 2020, 13:06:58) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
:~/.pyenv$ 
Also, before adding the environment packages and settings, when I did a pip list there were quite a few packages shown. Now there are only two ?

:~/.pyenv$ pip list
Package    Version
---------- -------
pip        20.0.2 
setuptools 41.2.0
EDIT - It's resolved regards the packages and pip. I obviously need to reinstall the missing ones
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Video recording with Raspberry Pi - What´s wrong with my python code? Montezuma1502 3 1,179 Feb-24-2023, 06:14 PM
Last Post: deanhystad
  How to output Python in Spout or any other video sharing network? buzzdarkyear 4 2,072 Jan-11-2022, 11:37 AM
Last Post: buzzdarkyear
  deleted Overdue 0 1,115 Dec-14-2021, 06:57 PM
Last Post: Overdue
  How to make a bot in pycharm for youtube for automatically adding python comments kodek2222 1 2,026 Jan-21-2021, 12:47 PM
Last Post: Aspire2Inspire
  How to preserve x-axis labels despite deleted subplot? Mark17 1 1,888 Dec-23-2020, 09:02 PM
Last Post: Mark17
  Openpyxl: Excel formula & condition formatting removed JaneTan 0 3,558 Sep-25-2020, 07:02 AM
Last Post: JaneTan
  Why is one duplicate not removed? Emekadavid 4 2,282 Jun-09-2020, 06:34 PM
Last Post: perfringo
  How to get Data-Taken For a Video file using Python ramprasad1211 1 1,862 Apr-28-2020, 08:48 AM
Last Post: ndc85430
  Get list of Video Device in python on Windows machine Michal 1 10,330 Apr-03-2020, 06:57 PM
Last Post: Mateusz
  Youtube video transcripts jehoshua 2 3,770 Feb-15-2020, 09:55 PM
Last Post: jehoshua

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020