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 ?
#1
Hi

I'm running Mint20 and am presently trying to follow a specific procedure that, I think, uses python 2 or python3 but is detecting some error in my python installation.
It could be possible as I previoulsy ran sudo apt install python-is-python3 /or made some modification to try something working some time ago...(making some alaises or simlink)

Here is the entire error I get that makes me thinking there are some python2/3 messed up :
"~/SBMS_update/electrodacus-esp32$ platformio run Processing serial (platform: https://github.com/platformio/platform-espressif32.git; board: nodemcu-32s; framework: arduino, espidf) Verbose mode can be enabled via -v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/...u-32s.html
PLATFORM: Espressif 32 (2.1.0+sha.a58a358) > NodeMCU-32S
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:

framework-arduinoespressif32 0.0.0+sha.d011dd7
framework-espidf 3.40001.200521 (4.0.1)
tool-cmake 3.16.4
tool-esptoolpy 1.30000.201119 (3.0.0)
tool-ninja 1.7.1
tool-openocd-esp32 2.1000.20201202 (10.0)
toolchain-esp32ulp 1.22851.191205 (2.28.51)
toolchain-xtensa32 2.80200.200827 (8.2.0)
Traceback (most recent call last):
File "genVersion.py", line 1, in
import subprocess
File "/usr/lib/python3.8/subprocess.py", line 49, in
import signal
File "/usr/lib/python3.8/signal.py", line 3, in
from functools import wraps as _wraps
File "/usr/lib/python3.8/functools.py", line 18, in
from collections import namedtuple
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
raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 53, in apport_excepthook
if not enabled():
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 24, in enabled
import re
File "/usr/lib/python3.8/re.py", line 127, in
import functools
File "/usr/lib/python3.8/functools.py", line 18, in
from collections import namedtuple
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
raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.

Original exception was:
Traceback (most recent call last):
File "genVersion.py", line 1, in
import subprocess
File "/usr/lib/python3.8/subprocess.py", line 49, in
import signal
File "/usr/lib/python3.8/signal.py", line 3, in
from functools import wraps as _wraps
File "/usr/lib/python3.8/functools.py", line 18, in
from collections import namedtuple
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
raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
OSError: 'python genVersion.py' exited 1:
File "/home/harold/.local/lib/python2.7/site-packages/platformio/builder/main.py", line 170:
env.SConscript("$BUILD_SCRIPT")
File "/home/harold/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 541:
return _SConscript(self.fs, *files, **subst_kw)
File "/home/harold/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 250:
exec file in call_stack[-1].globals
File "/home/harold/.platformio/platforms/espressif32/builder/main.py", line 224:
target_elf = env.BuildProgram()
File "/home/harold/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 224:
return self.method(*nargs, **kwargs)
File "/home/harold/.local/lib/python2.7/site-packages/platformio/builder/tools/platformio.py", line 61:
env.ProcessProgramDeps()
File "/home/harold/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 224:
return self.method(*nargs, **kwargs)
File "/home/harold/.local/lib/python2.7/site-packages/platformio/builder/tools/platformio.py", line 124:
env.ProcessFlags(env.get("BUILD_FLAGS"))
File "/home/harold/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 224:
return self.method(*nargs, **kwargs)
File "/home/harold/.local/lib/python2.7/site-packages/platformio/builder/tools/platformio.py", line 222:
env.Append(**env.ParseFlagsExtended(flags))
File "/home/harold/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 224:
return self.method(*nargs, **kwargs)
File "/home/harold/.local/lib/python2.7/site-packages/platformio/builder/tools/platformio.py", line 185:
for key, value in env.ParseFlags(str(raw)).items():
File "/home/harold/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 810:
do_parse(arg)
File "/home/harold/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 676:
arg = self.backtick(arg[1:])
File "/home/harold/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 594:
raise OSError("'%s' exited %d" % (command, status))
========================================== [FAILED] Took 0.37 seconds ==========================================

Environment Status Duration
serial FAILED 00:00:00.368
==================================== 1 failed, 0 succeeded in 00:00:00.368 ===================================="

My quetsion is : How could I fix to a proper installation of both python2 and python3 ?
Reply


Messages In This Thread
python2 python3 messed up : How to fix ? - by hary - Dec-29-2020, 09:29 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Sad Migrating of python2 script to python3 zuri 7 994 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