Page 1 of 1

[SOLVED] mg7.1 - python3 lib have two path

PostPosted: Nov 28th, '19, 16:33
by bitit
Good Morning
i'm in testing odoo1 in mageia7.1
but i have the following problem :
from default odoo and python3 packages are be installed in
/usr/lib/pyton3.7/site-pakages

but if i install some add-on by pip3
it will be installed in :
/usr/local/lib/pyton3.7/site-pakages

for this i have done a change in oddo.conf
writing on it the new path for add-on
anyway some add-on don't be loaded by software if i don't copy it in the original folder

is possible have only a folder for all python3 packages?

how?

i have think do copy any file from a folder in the other, deleting the first and linking the second folder in the place of the first.
can be right way?

What the more correct folder to maintain ?

Or maybe i can change where pip3 install the packages?

Enrico

Re: mg7.1 - python3 lib have two path

PostPosted: Nov 29th, '19, 12:14
by doktor5000
bitit wrote:Or maybe i can change where pip3 install the packages?

Yes that is possible. Check https://stackoverflow.com/questions/291 ... -using-pip

Re: mg7.1 - python3 lib have two path

PostPosted: Dec 10th, '19, 19:04
by bitit
well i have read the document linked ; now i have to much more confusion in my mind ; in the document is wrote a lot of solutions for many version of python ; what i search is a simple configurations file where i write my path destination .
i prefer /usr/lib/python3.7
instead /usr/local/lib/python3.7

Re: mg7.1 - python3 lib have two path

PostPosted: Dec 11th, '19, 20:24
by doktor5000
From what I can tell, you currently could either adjust your odoo configuration to use the paths where you installed packages with pip,
or you can remove the packages you installed with pip and reinstall them to the path where odoo expects them.

Re: mg7.1 - python3 lib have two path

PostPosted: Dec 14th, '19, 13:46
by bitit
isn't possible make a linear installations of italian electronic invoice in odoo11 in this way , how you move you find a error,

root@localhost lib]# pip3 install --target=/usr/lib/python3.7/site-packages/ odoo11-addon-account-fiscal-year
Traceback (most recent call last):
File "/usr/bin/pip3", line 11, in <module>
sys.exit(main())
TypeError: 'module' object is not callable
[root@localhost lib]# pip3 install --pre odoo11-addon-account-fiscal-year
Traceback (most recent call last):
File "/usr/bin/pip3", line 11, in <module>
sys.exit(main())
TypeError: 'module' object is not callable
[root@localhost lib]# pip3 install --pre odoo11-addon-account-fiscal-year
Traceback (most recent call last):
File "/usr/bin/pip3", line 11, in <module>
sys.exit(main())
TypeError: 'module' object is not callable
[root@localhost lib]# pip3 install --target=/usr/lib/python3.7/site-packages/ odoo11-addon-partner-firstname
Traceback (most recent call last):
File "/usr/bin/pip3", line 11, in <module>
sys.exit(main())
TypeError: 'module' object is not callable
[root@localhost lib]pip install --target=/usr/lib/python3.7/site-packages/ odoo11-addon-partner-firstname
Collecting odoo11-addon-partner-firstname
Downloading https://files.pythonhosted.org/packages ... ne-any.whl (83kB)
|████████████████████████████████| 92kB 770kB/s
ERROR: Could not find a version that satisfies the requirement odoo<11.1dev,>=11.0a (from odoo11-addon-partner-firstname) (from versions: none)
ERROR: No matching distribution found for odoo<11.1dev,>=11.0a (from odoo11-addon-partner-firstname)



the only way is make many tentatives, doing copy the libreries form a side to the other , until casually it work

Re: mg7.1 - python3 lib have two path

PostPosted: Dec 22nd, '19, 18:35
by bitit
for installing additional module, at the end i'm back in my first conf
https://forums.mageia.org/en/viewtopic.php?f=7&t=13151

you must change odoo.conf like in the link
for some app, that required particular add on
like for italian electronic invoice , you must copy the folder that pip install'll in /usr/local/lib... in /usr/lib/...
example :
Code: Select all
rpm -e --nodeps python2-yaml
pip install  PyYaml==3.13
pip install  PyXB==1.2.5

copy manually PyYaml , PyXB folders in /usr/bin/pithon3.7/site-packages

in this way seam to work.

but openugrade don't work, a lot of error; so if you have to import the odoo10 archive you must chose other way:
i believe in the future this two paths must be resolved .
enrico

Re: mg7.1 - python3 lib have two path

PostPosted: Jan 5th, '20, 15:25
by bitit
i have many test .
pip3 install -t /usr/lib/python3.7/site-packages setuptools

"-t /usr/lib/python3.7/site-packages " work properly for installing in indicated path.

Enrico