Why is pip freezing and not showing a module, although pip install says its already installed?

2024/10/12 8:26:10

I'm following these instructions to install Odoo on Mac. It required that I install all the Python modules for the user like so:

sudo pip install -—user -r requirements.txt

(*A note about the --user part)

However, when I run Odoo, I get this error:

./odoo-bin

Output:

Traceback (most recent call last):File "./odoo-bin", line 5, in <module>__import__('pkg_resources').declare_namespace('odoo.addons')File "/Library/Python/2.7/site-packages/setuptools-36.5.0-py2.7.egg/pkg_resources/__init__.py", line 2241, in declare_namespaceFile "/Library/Python/2.7/site-packages/setuptools-36.5.0-py2.7.egg/pkg_resources/__init__.py", line 2257, in declare_namespaceFile "/Library/Python/2.7/site-packages/setuptools-36.5.0-py2.7.egg/pkg_resources/__init__.py", line 2192, in _handle_nsFile "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 246, in load_modulemod = imp.load_module(fullname, self.file, self.filename, self.etc)File "/opt/odoo/odoo-10.0/odoo/__init__.py", line 64, in <module>import reportFile "/opt/odoo/odoo-10.0/odoo/report/__init__.py", line 5, in <module>from . import customFile "/opt/odoo/odoo-10.0/odoo/report/custom.py", line 20, in <module>from . import renderFile "/opt/odoo/odoo-10.0/odoo/report/render/__init__.py", line 4, in <module>from .simple import simpleFile "/opt/odoo/odoo-10.0/odoo/report/render/simple.py", line 8, in <module>import reportlab.lib
ImportError: No module named reportlab.lib

I noticed that this reportlab is available in requirements.txt:

reportlab==3.3.0

However, if I run this command

pip freeze | grep reportlab

I get nothing, but also when I run this command

sudo pip install --user reportlab

I get the following:

sudo pip install --user reportlab

Output:

The directory '/Users/odoo/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/odoo/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: reportlab in /Users/odoo/Library/Python/2.7/lib/python/site-packages
Requirement already satisfied: pillow>=2.4.0 in /Users/odoo/Library/Python/2.7/lib/python/site-packages (from reportlab)
Requirement already satisfied: pip>=1.4.1 in /Users/odoo/Library/Python/2.7/lib/python/site-packages (from reportlab)
Requirement already satisfied: setuptools>=2.2 in /Library/Python/2.7/site-packages/setuptools-36.5.0-py2.7.egg (from reportlab)
Requirement already satisfied: olefile in /Users/odoo/Library/Python/2.7/lib/python/site-packages (from pillow>=2.4.0->reportlab)

I have tried force reinstalling as suggested here, but that didn't do much.

How can I fix this?

Answer

inspired by dsgdfg's comment.. I simply followed installation instructions here.. and it worked just fine

update

the above isn't much a solution, b/c i had to go back and install every library mentioned in requirements.txt manually!! i just created a virtual env and it ran without a hitch from first attempt!

https://en.xdnf.cn/q/118221.html

Related Q&A

Flatten a list of strings which contains sublists

I have a list of strings which contains a sublist os strings:ids = [uspotify:track:3ftnDaaL02tMeOZBunIwls, uspotify:track:4CKjTXDDWIrS0cwSA9scgk, [uspotify:track:6oRbm1KOqskLTFc1rvGi5F, uspotify:track:…

Portscanner producing possible error

I have written a simple portscanner in python. I have already asked something about it, you can find the code here.I corrected the code and now am able to create a connection to e.g. stackoverflow.netB…

Import error on first-party library with dev_appserver.py

On Ubuntu 16.04, am suddenly getting import errors from the local GAE development server. The local dev server starts up, including the admin interface, but app no longer loads.Native python imports o…

Split dictionary based on values

I have a dictionary:data = {cluster: A, node: B, mount: [C, D, E]}Im trying to split the dictionary data into number of dictionaries based on values in key mount.I tried using:for value in data.items()…

Using defaultdict to parse multi delimiter file

I need to parse a file which has contents that look like this:20 31022550 G 1396 =:0:0.00:0.00:0.00:0:0:0.00:0.00:0.00:0:0.00:0.00:0.00 A:2:60.00:33.00:37.00:2:0:0.02:0.02:40.00:2:0.98:126.00…

Iterating in DataFrame and writing down the index of the values where a condition is met

I have a data made of 20 rows and 2500 columns. Each column is a unique product and rows are time series, results of measurements. Therefore each product is measured 20 times and there are 2500 product…

Access denied to ClearDB database using Python/Django on Heroku

Im trying to build a webapp on Heroku using Python/Django, and I just followed the tutorial to set up a Django project and push it to Heroku. However, I can never even get to the normal Django "I…

Replacing a line in a file based on a keyword search, by line from another file

Here is my file1: agadfadsdffasdfElement 1, 0, 0, 0PcomElement 2Here is my file2: PBARElement 1, 100, 200, 300, 400Element 2Continue...I want to search with a keyword, "Element 1" in file1,…

How to check for pop up alert using selenium in python

What I want is to continue with the next iteration if there is a pop up message in the webpage being scrapped. That is if there is any pop up message, I want to accept that message and go to the next i…

Rally host is non-existent or unreachable via pyral

I am trying to call rally server simply using below: rally = Rally(server, user, password, workspace=workspace, project=project)But it is giving below error:Traceback (most recent call last):File "…