Python Forum
python2 python3 messed up : How to fix ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python2 python3 messed up : How to fix ?
#4
The strange thing in your error message is this
Error:
File "/usr/lib/python3.8/collections/init.py", line 27, in from reprlib import recursive_repr as _recursive_repr File "/home/harold/.local/lib/python2.7/site-packages/reprlib/init.py", line 7, in
When the standard module 'collections' from python 3.8 library tries to import the stardard module 'reprlib', it imports it from /home/harold/.local/lib/python2.7/site-packages, that is to say from the python 2.7 library insteado of importing it from python 3.8's library. For me it means that at this moment, the directory /home/harold/.local/lib/python2.7/site-packages is mistakenly in the sys.path list.

I suggest that at the very top of genVersion.py, you add temporarily this line to see what sys.path contains when this line is executed. Then see if it contains a python 2.7 directory
import sys
raise RuntimeError(sys.path)
bowlofred likes this post
Reply


Messages In This Thread
python2 python3 messed up : How to fix ? - by hary - Dec-29-2020, 09:29 AM
RE: pytohn2 python3 messed up : How to fix ? - by Gribouillis - Dec-29-2020, 05:03 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Sad Migrating of python2 script to python3 zuri 7 995 Oct-05-2023, 02:40 PM
Last Post: snippsat
  Migration of Python2 and Python3 using Modernize and Future Rakshan 5 2,546 Oct-05-2023, 08:55 AM
Last Post: zuri
  Text Order is Kinda Messed Up? Prithak 0 1,045 Feb-03-2022, 04:00 PM
Last Post: Prithak
  Getting a small Python2 prog to run in Python3 steve140 4 3,903 Apr-19-2020, 09:27 AM
Last Post: steve140
  output mismatching when porting a python from python2 env to python3 env prayuktibid 2 2,575 Jan-21-2020, 04:41 AM
Last Post: prayuktibid
  python3 decoding problem but python2 OK mesbah 0 1,813 Nov-30-2019, 04:42 PM
Last Post: mesbah
  Gnuradio python3 is not compatible python3 xmlrpc library How Can I Fix İt ? muratoznnnn 3 4,932 Nov-07-2019, 05:47 PM
Last Post: DeaD_EyE
  Trying to run a python2 script dagamer1991 3 2,558 Aug-12-2019, 12:33 PM
Last Post: buran
  I think I messed up python.... XavPro_QC 7 14,139 Aug-02-2019, 09:02 PM
Last Post: XavPro_QC
  python2.7 executables thus the system python2.7 was erroring utility.execute()? vivekm 1 1,765 May-20-2019, 11:24 AM
Last Post: vivekm

Forum Jump:

User Panel Messages

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