kalliope-project / kalliope

Kalliope is a framework that will help you to create your own personal assistant.
https://kalliope-project.github.io/
GNU General Public License v3.0
1.71k stars 229 forks source link

python setuptools bad marshal data (unknown type code) #664

Closed joshiayush closed 2 years ago

joshiayush commented 2 years ago

Description

When I go with the Kalliope's manual installation guide Method 3 - Developer install using Virtualenv I get the following result:

Traceback (most recent call last): File "setup.py", line 115, in 'kalliope=kalliope:main', File "/Python/kalliope/venv/lib/python3.7/site-packages/setuptools/init.py", line 153, in setup return distutils.core.setup(**attrs) File "/usr/lib/python3.7/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/Python/kalliope/venv/lib/python3.7/site-packages/setuptools/command/install.py", line 67, in run self.do_egg_install() File "/Python/kalliope/venv/lib/python3.7/site-packages/setuptools/command/install.py", line 109, in do_egg_install self.run_command('bdist_egg') File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/Python/kalliope/venv/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 212, in run os.path.join(archive_root, 'EGG-INFO'), self.zip_safe() File "/Python/kalliope/venv/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 265, in zip_safe return analyze_egg(self.bdist_dir, self.stubs) File "/Python/kalliope/venv/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 339, in analyze_egg safe = scan_module(egg_dir, base, name, stubs) and safe File "/Python/kalliope/venv/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 376, in scan_module code = marshal.load(f) ValueError: bad marshal data (unknown type code)

Expectation

It should work fine as the Kalliope's manual installation guide Method 3 - Developer install using Virtualenv instructed.

Environment

OS: Ubuntu 20.04.3 LTS Interpreter: python3.7.12

joshiayush commented 2 years ago

I get the ValueError: bad marshal data (unknown type code) which appears to have been some sort of regression in setuptools with python 3.7. See #1257. If this is the case with you, you may want to follow the steps described below:

sudo pip3 install --upgrade --force-reinstall setuptools

Forcing the reinstallation of setuptools fixed this issue for me it may fix the issue for you as well. If this does not resolve the issue for you then you may want to follow the steps described below:

find /usr -name '*.pyc' -delete

If the issue is not with the setuptools this mean that some .pyc files are corrupt probably. In debian distributions the easier way to fix this issue is by deleting those files. This method is highly discouraged please use it if you don't find any other solution working for you.

joshiayush commented 2 years ago

@Sispheor What do you think? Will this issue happen to anyone else, because if that's the case, it would be reasonable to add information about this issue in the Kalliope's documents.

corus87 commented 2 years ago

It does not happen to anyone else, at least not to me. I just successful installed Kalliope in a virtual env. I only had an error with "werkzeug" and installing ansible with easy_install. For the werkzeug error I will send a PR.

Not sure but maybe the error only occurs on python 3.7, I used python 3.8

joshiayush commented 2 years ago

@corus87 I'm not sure either that if this only happened to me or it will happen to anyone else. One solution could be as you said "use python3.8" but, this information seems to be missing from the Kalliope's documents see

Ubuntu 20.04

Install some required system libraries and software:

sudo apt update
sudo apt install -y \
   git python3-dev libsmpeg0 libttspico-utils flac \
   libffi-dev libssl-dev portaudio19-dev build-essential \
   libatlas3-base mplayer wget vim sudo locales alsa-base alsa-utils \
   pulseaudio-utils libasound2-plugins python3-pyaudio libasound-dev \
   libportaudio2 libportaudiocpp0 ffmpeg 

As you can see the Python's major version, minor version and the revision is missing. So you don't know exactly which version of python does Kalliope require. It would be reasonable to at least add the information about the minor version of python.

My minor version is 7 and the revision is 12, so the above issue may happen to somebody if they have the same. But if you are sure that this will not happen to anyone else please let me know I'll close this issue. Thanks!

Sispheor commented 2 years ago

Installation fixed in the last release