简体   繁体   中英

Is this a safe way to install simplejson for python 2.4 manually?

Mission: install simplejson(python2.4) to a chroot environment(no internet, no easy_install)

  1. I download a simplejson library
  2. unzip it
  3. Do a python setup.py install --prefix=my_chroot_path finish, but not doc found.
  4. I found there is a simplejson directory in the unzip directory, now I copy this to my chroot_path, I can use it.

Question: is step 4 effective????

You could either install it to a location which is in the pythonpath. Check the path via:

import sys
print sys.path

(Depending on your OS, you can change the PYTHONPATH-Enviroment variable via command-line or other options).

Or (and this is the preferred method), just install it via pip install simplejson , which takes care of the dependecies, locations and stuff like that. It's even documented here . Check the pip installation instructions there as well.

Edit : Sorry, once there is no easy_install, you have to manually put simplejson in the pythonpath-folder, I guess.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM