Ubuntu 12.04下Virtualenv中安装Twisted失败求助
Hey there, let's work through this Twisted installation issue you're hitting in your virtualenv on Ubuntu 12.04. That Command "python setup.py egg_info" failed with error code 1 error is usually tied to missing system dependencies or outdated packaging tools. Here are actionable steps to fix it:
Install required system-level build dependencies
Twisted needs certain libraries and compilers to build from source. Run these commands first (you'll need sudo access):sudo apt-get update sudo apt-get install build-essential python-dev libssl-dev libffi-devbuild-essentialprovides the basic compiler tools,python-devgives Python header files needed for compiling extensions, andlibssl-dev/libffi-devhandle encryption-related dependencies Twisted relies on.Upgrade pip and setuptools in your virtualenv
Outdated versions of pip or setuptools often causeegg_infoprocessing failures. Activate your virtualenv first, then run:pip install --upgrade pip setuptoolsThis ensures you're using the latest compatible versions of these tools for Python 2.7.
Install a Twisted version compatible with Ubuntu 12.04
Newer Twisted releases dropped support for older systems like Ubuntu 12.04. Try installing a specific older version that works with your setup:pip install twisted==15.5.0Version 15.5.0 is known to be compatible with Python 2.7 and Ubuntu 12.04's system libraries.
Recreate your virtualenv (if the above steps fail)
Sometimes virtualenv environments can get corrupted. Try starting fresh:# Exit the current virtualenv deactivate # Delete the old environment rm -rf /home/rico/solidwork # Create a new virtualenv virtualenv solidwork # Activate it again source solidwork/bin/activate # Install the compatible Twisted version pip install twisted==15.5.0
Note: The SNIMissingWarning you're seeing is just a heads-up that Ubuntu 12.04's OpenSSL version doesn't support SNI (Server Name Indication), but it's not the root cause of your installation failure. Fixing the dependencies above should resolve the main error.
内容的提问来源于stack exchange,提问作者z.rico

