How do I fix the jsonobject architecture problem I am having in PyCharm CE when the terminal says the package is installed?

23 views Asked by At

How do I get jsonobject to install even though, apparently, my terminal thinks is already installed?

I am trying to work through the a Python project that I have copied to a repo and cloned from the open-source code in this GitHub repo

I am using PyCharm CE (Build #PC-233.15026.15, built on March 21, 2024, Runtime version: 17.0.10+1-b1087.23 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.)

Python version is 3.11

My Mac OS is: Monterey version 12.7.4 This is a Mac from 2013 so has the Intel infrastructure.

I have managed to install all dependences apart from jsonobject.

My terminal seems to think that jsonobject has been installed:

(base) [name here] ~ % ARCHFLAGS="-arch x86_64" pip install jsonobject
Requirement already satisfied: jsonobject in /Applications/anaconda3/lib/python3.11/site-packages (2.1.0)
Requirement already satisfied: six in /Applications/anaconda3/lib/python3.11/site-packages (from jsonobject) (1.16.0)

The content of that folder is Content of json folder

It is not, however, showing in the Python Interpreter list: List of package things in the Python Interpreter, no jsonobject

But I still get this error inside PyCharm ([MY FILE PATH HERE] is substituting for the local path to the folder):

 [MY FILE PATH HERE]/SynthPops/.venv/bin/python 
 [MY FILE PATH HERE]/SynthPops/examples/ex01_make_dhaka_city.py 
Traceback (most recent call last):
 File "[MY FILE PATH HERE]/SynthPops/examples/ex01_make_dhaka_city.py", line 6, in <module>
import synthpops as sp
File "[MY FILE PATH HERE]/SynthPops/synthpops/__init__.py", line 5, in <module>
from .data import *  # depends on defaults, config
^^^^^^^^^^^^^^^^^^^
File "[MY FILE PATH HERE]/SynthPops/synthpops/data.py", line 5, in <module>
from jsonobject import *
ModuleNotFoundError: No module named 'jsonobject'

Process finished with exit code 1

When trying to install jsonobject from inside PyCharm I received the same unsupported architecture errors as shown in questions such as pycurl architecture problem and psutil architecture problem. The solution in both was to run

 ARCHFLAGS="-arch x86_64" pip install [name]

which, in my case, is jsonobject. That line still failed inside PyCharm although it appeared to work in the terminal.

0

There are 0 answers