Python 3.3 source code setup: modules were not found: _lzma _sqlite3 _tkinter

前端 未结 4 1878
梦毁少年i
梦毁少年i 2021-02-03 11:02

I am trying to set up the compiled version of CPython, on Ubuntu 12.04, by following the python developer guide. Even after installing the dependent packages lzma and sqlite3,

相关标签:
4条回答
  • 2021-02-03 11:42

    I was able to build Python 3.3 without modifying setup.py after installing the following packages on my Ubuntu Precise box.

    build-essential 
    zlib1g-dev 
    libbz2-dev 
    libncurses5-dev 
    libreadline6-dev 
    libsqlite3-dev 
    libssl-dev 
    libgdbm-dev
    liblzma-dev
    tk8.5-dev
    
    0 讨论(0)
  • 2021-02-03 11:45

    The lack of finding lzma and sqlite3 may be because your paths (LD_LIBRARY_PATH in particular) were incorrect. How did you install those two packages; did you use the package manager? If you installed manually, where did you install them? Also, did you install the development versions, if you used the package manager to install lzma and sqlite3? When installing from source, you'll need the development versions, so Python's source can find the necessary include files.

    Further, you may have to edit setup.py to indicate where these packages can be found.

    As for tkinter: this relies on tcl/tk, so check that you have the development versions of these packages installed if you're installing python/tkinter from source.

    0 讨论(0)
  • 2021-02-03 11:45

    This works for me (Python 3.4, Ubuntu 13.04) meaning "make" completes cleanly:

    sudo apt-get install build-essential python-dev libncurses*-dev \
                         liblzma-dev libgdbm-dev libsqlite3-dev \
                         libbz2-dev tk-dev
    

    Install:

    cd python3.4
    make clean && ./configure && make && sudo make install
    
    0 讨论(0)
  • 2021-02-03 11:47

    I used the instructions here: python-on-debian-wheezy

    But I also had to install tk-dev which wasn't listed there.

    0 讨论(0)
提交回复
热议问题