Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python No module named ujson, while it's already installed

I've installed ujson using command pip install ujson and when I've tried to run my python project it returns ImportError: No module named ujson

  • OS version: Red Hat Enterprise Linux Server release 7.2 (Maipo)
  • Python version: Python 2.7.6
  • pip list: ujson (1.35)

Any help please?

like image 715
Amjad Omari Avatar asked May 23 '16 07:05

Amjad Omari


People also ask

What is uJson in Python?

ujson (UltraJSON) is an ultra fast JSON encoder and decoder written in pure C with bindings for Python 3.7+. orjson is a fast, correct JSON library for Python. It is the fastest python library for json encoding & decoding. It serializes dataclass, datetime, numpy, and UUID instances natively.

What is uJson?

uJson is a new JSON library for the Scala programming language. It serves as the back-end for the uPickle serializaiton library, but can be used standalone to manipulate JSON in a way that is fast, flexible and intuitive, far more than the existing JSON libraries in the Scala library ecosystem.


1 Answers

The problem was that the PYTHONPATH variable is empty, and when I added the path to the variable it works.

export PYTHONPATH=$PYTHONPATH:/usr/lib64/python2.7/site-packages
like image 74
Amjad Omari Avatar answered Sep 19 '22 00:09

Amjad Omari