mazim-co / MMM-MyVolvo

MagicMirror Module for Volvo Cars
1 stars 0 forks source link

How do I install? #2

Open m4nino opened 1 month ago

m4nino commented 1 month ago

How do I instalI this module?

I understand this python program have to be installed first, but there I get stucked. I get this message when I do the test:

**@raspberrypi:~ $ voc list Unknown source file: list **@raspberrypi:~ $

I’m 100% sure I wrote the right username and password. What could be wrong? I’m fairly new to Raspberry Pi and Magic Mirror, but I do can install other modules. I have done the update to python 10.4.

Ok, so I did this cd ~/MagicMirror/modules git clone https://github.com/molobrakos/volvooncall.git cd volvooncall python setup.py install (HERE, I could to this, got a message about I could do this. So I did change this one to Sudo python setup.py install, then everyting went fine… or maybe not? I don’t know.

Then I did this touch .voc.conf nano .voc.conf Wrote my username and password in the file: username: ------@outlook.*om password: <------->

After that I’d press the CTRL+X , save, and enter. Then I wrote voc test and I got the line Unknown source file: list

Ok, shit happens I did try to install the MMM-MyVolvo anyway.

cd ~/MagicMirror/modules git clone https://github.com/mazim-co/MMM-MyVolvo cd MMM-MyVolvo npm install

I did the config then restart MM and module wont show up. After this I did test pip install volvooncall also but that was alot of guessing so probably did’nt get that right either. What am I doing wrong? image image

mazim-co commented 1 month ago

Hello @m4nino - it looks like the script "python setup.py install" wasnt executed properly. You need to install python3. Can you please share your version you have right now?

python3 --version

image

m4nino commented 1 month ago

Hi there! In one place, there is information about you need python 3.8 or higher, in another place, there is information about you need 3.10 or higher, so I did the update to 3.10. Maybe I did something wrong. 2024-06-03-102042_1920x1080_scrot

mazim-co commented 1 month ago

Alright, based on the doc from molobrakos it should actually work, that is weird. However, I have on my two devices python 3.8.5 and the modules as well as the installation worked perfectly. Could you try installing Python 3.8 and test it again?

m4nino commented 1 month ago

Ok, so I wasnt sure about how to downgrade to python 3.8 again, so I did reinstall the Magic Mirror and now I have the python 3.11... Hm. I tried anyway and got the same error as with the 3.8 first time and the 3.10 second. I will show u what happen.

First I get an error when I wrote python3 setup.py install and when I try again wrote sudo python3 setup.py install the install seem to work, but then the installation ends with another error. Do you understand what this is about?

``m@raspberrypi:~$ python --version Python 3.11.2 m@raspberrypi:~ $ python3 --version Python 3.11.2 m@raspberrypi:~ $ cd MagicMirror m@raspberrypi:~/MagicMirror $ cd modules m@raspberrypi:~/MagicMirror/modules $ git clone https://github.com/molobrakos/volvooncall.git Klonar till "volvooncall"... remote: Enumerating objects: 2214, done. remote: Counting objects: 100% (273/273), done. remote: Compressing objects: 100% (110/110), done. remote: Total 2214 (delta 154), reused 220 (delta 145), pack-reused 1941 Tar emot objekt: 100% (2214/2214), 352,63 KiB | 2,47 MiB/s, klart. Analyserar delta: 100% (1448/1448), klart. m@raspberrypi:~/MagicMirror/modules $ cd volvooncall m@raspberrypi:~/MagicMirror/modules/volvooncall $ python3 setup.py install running install /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( /usr/lib/python3/dist-packages/setuptools/command/easy_install.py:146: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the installation directory:

[Errno 13] Permission denied: '/usr/local/lib/python3.11/dist-packages/test-easy-install-3434.write-test' The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was:

/usr/local/lib/python3.11/dist-packages/ Perhaps your account does not have write access to this directory? If the installation directory is a system-owned directory, you may need to sign in as the administrator or "root" account. If you do not have administrative access to this machine, you may wish to choose a different installation directory, preferably one that is listed in your PYTHONPATH environment variable.

For information on other options, you may wish to consult the documentation at:

https://setuptools.pypa.io/en/latest/deprecated/easy_install.html

Please make the appropriate changes for your system and try again.

m@raspberrypi:~/MagicMirror/modules/volvooncall $ sudo python3 setup.py install running install /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( /usr/lib/python3/dist-packages/setuptools/command/easy_install.py:146: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( running bdist_egg running egg_info creating volvooncall.egg-info writing volvooncall.egg-info/PKG-INFO writing dependency_links to volvooncall.egg-info/dependency_links.txt writing requirements to volvooncall.egg-info/requires.txt writing top-level names to volvooncall.egg-info/top_level.txt writing manifest file 'volvooncall.egg-info/SOURCES.txt' reading manifest file 'volvooncall.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' adding license file 'LICENSE' writing manifest file 'volvooncall.egg-info/SOURCES.txt' installing library code to build/bdist.linux-armv7l/egg running install_lib running build_py creating build creating build/lib creating build/lib/volvooncall copying volvooncall/mqtt.py -> build/lib/volvooncall copying volvooncall/volvooncall.py -> build/lib/volvooncall copying volvooncall/dashboard.py -> build/lib/volvooncall copying volvooncall/init.py -> build/lib/volvooncall copying volvooncall/util.py -> build/lib/volvooncall creating build/bdist.linux-armv7l creating build/bdist.linux-armv7l/egg creating build/bdist.linux-armv7l/egg/volvooncall copying build/lib/volvooncall/mqtt.py -> build/bdist.linux-armv7l/egg/volvooncall copying build/lib/volvooncall/volvooncall.py -> build/bdist.linux-armv7l/egg/volvooncall copying build/lib/volvooncall/dashboard.py -> build/bdist.linux-armv7l/egg/volvooncall copying build/lib/volvooncall/init.py -> build/bdist.linux-armv7l/egg/volvooncall copying build/lib/volvooncall/util.py -> build/bdist.linux-armv7l/egg/volvooncall byte-compiling build/bdist.linux-armv7l/egg/volvooncall/mqtt.py to mqtt.cpython-311.pyc byte-compiling build/bdist.linux-armv7l/egg/volvooncall/volvooncall.py to volvooncall.cpython-311.pyc byte-compiling build/bdist.linux-armv7l/egg/volvooncall/dashboard.py to dashboard.cpython-311.pyc byte-compiling build/bdist.linux-armv7l/egg/volvooncall/init.py to init.cpython-311.pyc byte-compiling build/bdist.linux-armv7l/egg/volvooncall/util.py to util.cpython-311.pyc creating build/bdist.linux-armv7l/egg/EGG-INFO installing scripts to build/bdist.linux-armv7l/egg/EGG-INFO/scripts running install_scripts running build_scripts creating build/scripts-3.11 copying and adjusting voc -> build/scripts-3.11 changing mode of build/scripts-3.11/voc from 644 to 755 creating build/bdist.linux-armv7l/egg/EGG-INFO/scripts copying build/scripts-3.11/voc -> build/bdist.linux-armv7l/egg/EGG-INFO/scripts changing mode of build/bdist.linux-armv7l/egg/EGG-INFO/scripts/voc to 755 copying volvooncall.egg-info/PKG-INFO -> build/bdist.linux-armv7l/egg/EGG-INFO copying volvooncall.egg-info/SOURCES.txt -> build/bdist.linux-armv7l/egg/EGG-INFO copying volvooncall.egg-info/dependency_links.txt -> build/bdist.linux-armv7l/egg/EGG-INFO copying volvooncall.egg-info/requires.txt -> build/bdist.linux-armv7l/egg/EGG-INFO copying volvooncall.egg-info/top_level.txt -> build/bdist.linux-armv7l/egg/EGG-INFO zip_safe flag not set; analyzing archive contents... volvooncall.pycache.volvooncall.cpython-311: module references file creating dist creating 'dist/volvooncall-0.10.4-py3.11.egg' and adding 'build/bdist.linux-armv7l/egg' to it removing 'build/bdist.linux-armv7l/egg' (and everything under it) Processing volvooncall-0.10.4-py3.11.egg creating /usr/local/lib/python3.11/dist-packages/volvooncall-0.10.4-py3.11.egg Extracting volvooncall-0.10.4-py3.11.egg to /usr/local/lib/python3.11/dist-packages Adding volvooncall 0.10.4 to easy-install.pth file Installing voc script to /usr/local/bin

Installed /usr/local/lib/python3.11/dist-packages/volvooncall-0.10.4-py3.11.egg Processing dependencies for volvooncall==0.10.4 Searching for aiohttp<4.0 Reading https://pypi.org/simple/aiohttp/ Downloading https://files.pythonhosted.org/packages/04/a4/e3679773ea7eb5b37a2c998e25b017cc5349edf6ba2739d1f32855cfb11b/aiohttp-3.9.5.tar.gz#sha256=edea7d15772ceeb29db4aff55e482d4bcfb6ae160ce144f2682de02f6d693551 Best match: aiohttp 3.9.5 Processing aiohttp-3.9.5.tar.gz Writing /tmp/easy_install-3yd1dphl/aiohttp-3.9.5/setup.cfg Running aiohttp-3.9.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-3yd1dphl/aiohttp-3.9.5/egg-dist-tmp-5a32wgl1

Accelerated build * warning: no files found matching 'aiohttp' anywhere in distribution warning: no previously-included files matching '.pyc' found anywhere in distribution warning: no previously-included files matching '.pyd' found anywhere in distribution warning: no previously-included files matching '.so' found anywhere in distribution warning: no previously-included files matching '.lib' found anywhere in distribution warning: no previously-included files matching '.dll' found anywhere in distribution warning: no previously-included files matching '.a' found anywhere in distribution warning: no previously-included files matching '.obj' found anywhere in distribution warning: no previously-included files found matching 'aiohttp/.html' no previously-included directories found matching 'docs/_build' /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( Traceback (most recent call last): File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 156, in save_modules yield saved File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 198, in setup_context yield File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 259, in run_setup _execfile(setup_script, ns) File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 46, in _execfile exec(code, globals, locals) File "/tmp/easy_install-3yd1dphl/aiohttp-3.9.5/setup.py", line 54, in File "/usr/lib/python3/dist-packages/setuptools/init.py", line 108, in setup return distutils.core.setup(**attrs)

File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 185, in setup return run_commands(dist)

File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 201, in run_commands dist.run_commands() File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 969, in run_commands self.run_command(cmd) File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 1213, in run_command super().run_command(command) File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 165, in run cmd = self.call_command('install_lib', warn_dir=0)

File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 151, in call_command self.run_command(cmdname) File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 318, in run_command self.distribution.run_command(command) File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 1213, in run_command super().run_command(command) File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 987, in run_command cmd_obj.ensure_finalized() File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized self.finalize_options() File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 17, in finalize_options self.set_undefined_options('install',('install_layout','install_layout')) File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 296, in set_undefined_options setattr(self, dst_option, getattr(src_cmd_obj, src_option)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 107, in getattr raise AttributeError(attr) AttributeError: install_layout. Did you mean: 'install_platlib'?

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/m/MagicMirror/modules/volvooncall/setup.py", line 2, in setup() File "/usr/lib/python3/dist-packages/setuptools/init.py", line 108, in setup return distutils.core.setup(**attrs)

File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 185, in setup return run_commands(dist)

File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 201, in run_commands dist.run_commands() File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 969, in run_commands self.run_command(cmd) File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 1213, in run_command super().run_command(command) File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 74, in run self.do_egg_install() File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 131, in do_egg_install cmd.run(show_deprecation=False) File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 444, in run self.easy_install(spec, not self.no_deps) File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 686, in easy_install return self.install_item(None, spec, tmpdir, deps, True)

File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 733, in install_item self.process_distribution(spec, dist, deps) File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 778, in process_distribution distros = WorkingSet([]).resolve(

File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 815, in resolve dist = self._resolve_dist(

File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 851, in _resolve_dist dist = best[req.key] = env.best_match(

File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 1123, in best_match return self.obtain(req, installer)

File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 1135, in obtain return installer(requirement)

File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 705, in easy_install return self.install_item(spec, dist.location, tmpdir, deps) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 731, in install_item dists = self.install_eggs(spec, download, tmpdir)

File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 924, in install_eggs return self.build_and_install(setup_script, setup_base)

File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1198, in build_and_install self.run_setup(setup_script, setup_base, args) File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1182, in run_setup run_setup(setup_script, args) File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 249, in run_setup with setup_context(setup_dir): File "/usr/lib/python3.11/contextlib.py", line 155, in exit self.gen.throw(typ, value, traceback) File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 190, in setup_context with save_modules(): File "/usr/lib/python3.11/contextlib.py", line 155, in exit self.gen.throw(typ, value, traceback) File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 169, in save_modules saved_exc.resume() File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 143, in resume raise exc.with_traceback(self._tb) File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 156, in save_modules yield saved File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 198, in setup_context yield File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 259, in run_setup _execfile(setup_script, ns) File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 46, in _execfile exec(code, globals, locals) File "/tmp/easy_install-3yd1dphl/aiohttp-3.9.5/setup.py", line 54, in File "/usr/lib/python3/dist-packages/setuptools/init.py", line 108, in setup return distutils.core.setup(**attrs)

File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 185, in setup return run_commands(dist)

File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 201, in run_commands dist.run_commands() File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 969, in run_commands self.run_command(cmd) File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 1213, in run_command super().run_command(command) File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 165, in run cmd = self.call_command('install_lib', warn_dir=0)

File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 151, in call_command self.run_command(cmdname) File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 318, in run_command self.distribution.run_command(command) File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 1213, in run_command super().run_command(command) File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 987, in run_command cmd_obj.ensure_finalized() File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized self.finalize_options() File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 17, in finalize_options self.set_undefined_options('install',('install_layout','install_layout')) File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 296, in set_undefined_options setattr(self, dst_option, getattr(src_cmd_obj, src_option))

File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 107, in getattr raise AttributeError(attr) AttributeError: install_layout m@raspberrypi:~/MagicMirror/modules/volvooncall $ ``

mazim-co commented 1 month ago

have you tried to install it with sudo?

m4nino commented 1 month ago

Like "m@raspberrypi:~/MagicMirror/modules/volvooncall $ sudo python3 setup.py install"? If yes, see my last post again.

mazim-co commented 1 month ago

I missed that. I recall having a similar issue years ago, and I believe I installed it outside the modules folder. The script is actually unrelated to MagicMirror. I installed it in the root directory.

cd ~
git clone https://github.com/molobrakos/volvooncall.git
cd volvooncall
python3 setup.py install
m4nino commented 1 month ago

Hmm interesting, I did try outside the modules folder, and outside the Magic Mirror folder, both of it needed sudo python3 setup.py install and generate error unfortunately. "AttributeError: install_layoute". :(

m4nino commented 1 month ago

Ok, one last try. I did go from Raspberry pi 32bit OS to 64bit. (Don't ask... the 32bit works faster for me). And now it wasnt any error during installation, but I can't do the voc list and get correct answer. The module do not show either. When I do the voc list i get this:

m@raspberrypi:~/MagicMirror/volvooncall $ voc list Traceback (most recent call last): File "/usr/local/bin/voc", line 4, in import('pkg_resources').run_script('volvooncall==0.10.4', 'voc') File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 708, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 1517, in run_script exec(code, namespace, namespace) File "/usr/local/lib/python3.11/dist-packages/volvooncall-0.10.4-py3.11.egg/EGG-INFO/scripts/voc", line 41, in import docopt ModuleNotFoundError: No module named 'docopt' m@raspberrypi:~/MagicMirror/volvooncall $

I did try to place the module in the folder modules and outside.

mazim-co commented 1 month ago

Hey - sorry, that is annoying. It looks like docopt is not installed. Please try to install that via sudo apt install python3-docopt. If that still not work I would recommend to ask in MagicMirror Forum. These guys are really helpful.

But what I can tell you is that the module works perfect as soon as you got the script running. Good Luck!

mazim-co commented 1 month ago

Try also this: pip3 install git+https://github.com/molobrakos/volvooncall.git

m4nino commented 1 month ago

Ok, so I did the sudo apt install python3-docopt and then it tell me the problem now is something with my username and password. " Missing configuration: Connection.init() missing 2 required positional arguments: 'username' and 'password' " I'm 100% sure I wrote my name and password right and I have tried different ways with space and thing like that. I will ask the ppl in the MM forum, but first I have to try the link u wrote. How am I supposed to use it? pip3 install git+https://github.com/molobrakos/volvooncall.git