Deprecation: Python 2.7 [SOLVED]

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
Black Swordsman
Level 2
Level 2
Posts: 74
Joined: Thu Feb 22, 2018 8:48 pm
Location: Syracuse, Indiana

Deprecation: Python 2.7 [SOLVED]

Post by Black Swordsman » Sat Apr 20, 2019 12:50 am

So I am working on teaching myself python and have just been learning about virtualenv and how it can help to make things more stable when working with different versions of things but when I had set it up I had received the message

Code: Select all

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Is there a way that I can set up pip and virtualenv to default to Python 3.6 (which is already pre-installed onto mint)?

Code: Select all

System:    Host: raun-Game Kernel: 4.15.0-20-generic x86_64 bits: 64 gcc: 7.3.0
           Desktop: Cinnamon 3.8.9 (Gtk 3.22.30-1ubuntu2) Distro: Linux Mint 19 Tara
Machine:   Device: desktop Mobo: ASUSTeK model: P8Z77-V LX v: Rev X.0x serial: N/A
           BIOS: American Megatrends v: 2501 date: 07/21/2014
CPU:       Quad core Intel Core i7-3770K (-MT-MCP-) arch: Ivy Bridge rev.9 cache: 8192 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 28084
           clock speeds: max: 3900 MHz 1: 1678 MHz 2: 1624 MHz 3: 1666 MHz 4: 1687 MHz 5: 1645 MHz 6: 1616 MHz
           7: 1625 MHz 8: 1670 MHz
Graphics:  Card: Advanced Micro Devices [AMD/ATI] Tahiti XT [Radeon HD 7970/8970 OEM / R9 280X] bus-ID: 01:00.0
           Display Server: x11 (X.Org 1.19.6 ) drivers: ati,radeon (unloaded: modesetting,fbdev,vesa)
           Resolution: 1920x1080@60.00hz
           OpenGL: renderer: AMD TAHITI (DRM 2.50.0, 4.15.0-20-generic, LLVM 7.0.0)
           version: 4.5 Mesa 18.2.8 Direct Render: Yes
Audio:     Card-1 Intel 7 Series/C216 Family High Definition Audio Controller
           driver: snd_hda_intel bus-ID: 00:1b.0
           Card-2 Advanced Micro Devices [AMD/ATI] Tahiti HDMI Audio [Radeon HD 7870 XT / 7950/7970]
           driver: snd_hda_intel bus-ID: 01:00.1
           Sound: Advanced Linux Sound Architecture v: k4.15.0-20-generic
Network:   Card: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
           driver: r8169 v: 2.3LK-NAPI port: d000 bus-ID: 03:00.0
           IF: enp3s0 state: down mac: <filter>
Drives:    HDD Total Size: 500.1GB (48.9% used)
           ID-1: /dev/sda model: ST500DM002 size: 500.1GB
Partition: ID-1: / size: 458G used: 228G (53%) fs: ext4 dev: /dev/sda1
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 29.8C mobo: 27.8C gpu: 46.0
           Fan Speeds (in rpm): cpu: 0
Info:      Processes: 249 Uptime: 5 days Memory: 5991.5/15988.2MB Init: systemd runlevel: 5 Gcc sys: 7.3.0
           Client: Shell (bash 4.4.191) inxi: 2.3.56 
Last edited by Black Swordsman on Tue Apr 23, 2019 8:40 pm, edited 1 time in total.

deepakdeshp
Level 16
Level 16
Posts: 6253
Joined: Sun Aug 09, 2015 10:00 am

Re: Deprecation: Python 2.7

Post by deepakdeshp » Sat Apr 20, 2019 1:28 am

If you want to use the 3.6 version, use it as the first shebang line in your script.
https://bash.cyberciti.biz/guide/Shebang
Your first line would be
#!/usr/bin/python3.6
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help, and keeps the forum clean.
Regards,
Deepak

I am using Mint 19.2 Cinnamon 64 bit with AMD A8/7410 processor . Memory 8GB

Black Swordsman
Level 2
Level 2
Posts: 74
Joined: Thu Feb 22, 2018 8:48 pm
Location: Syracuse, Indiana

Re: Deprecation: Python 2.7

Post by Black Swordsman » Sat Apr 20, 2019 2:30 am

I do not think that I am understanding you...do you mean my first line in whatever code that I am writing? or do you mean that I need to put that into terminal whenever I go to use Virtualenv?

User avatar
AndyMH
Level 9
Level 9
Posts: 2671
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Deprecation: Python 2.7

Post by AndyMH » Sat Apr 20, 2019 6:04 pm

my first line in whatever code that I am writing
Yes
Is there a way that I can set up pip
Have you installed python3-pip? If so, then instead of typing pip install xyz in a terminal, it is pip3 install xyz.
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

deepakdeshp
Level 16
Level 16
Posts: 6253
Joined: Sun Aug 09, 2015 10:00 am

Re: Deprecation: Python 2.7

Post by deepakdeshp » Sun Apr 21, 2019 12:40 pm

Black Swordsman wrote:
Sat Apr 20, 2019 2:30 am
I do not think that I am understanding you...do you mean my first line in whatever code that I am writing? or do you mean that I need to put that into terminal whenever I go to use Virtualenv?
That should be the first line in your script not in terminal. The link explain it
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help, and keeps the forum clean.
Regards,
Deepak

I am using Mint 19.2 Cinnamon 64 bit with AMD A8/7410 processor . Memory 8GB

Black Swordsman
Level 2
Level 2
Posts: 74
Joined: Thu Feb 22, 2018 8:48 pm
Location: Syracuse, Indiana

Re: Deprecation: Python 2.7

Post by Black Swordsman » Tue Apr 23, 2019 8:40 pm

Okay thank you, I think I understand now

Post Reply

Return to “Software & Applications”