I have a fresh Ubuntu 22.04 installation. I have installed build-essentials and python3-dev.
When I try pip install uwsgi
I'm getting the following output:
Collecting uwsgi
Using cached uwsgi-2.0.20.tar.gz (804 kB)
Preparing metadata (setup.py) ... done
Using legacy 'setup.py install' for uwsgi, since package 'wheel' is not installed.
Installing collected packages: uwsgi
Running setup.py install for uwsgi ... error
error: subprocess-exited-with-error
× Running setup.py install for uwsgi did not run successfully.
│ exit code: 1
╰─> [265 lines of output]
/usr/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'descriptions'
warnings.warn(msg)
running install
/opt/virtualenv/test_env/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
using profile: buildconf/default.ini
detected include path: ['/usr/lib/gcc/x86_64-linux-gnu/11/include', '/usr/local/include', '/usr/include/x86_64-linux-gnu', '/usr/include']
Patching "bin_name" to properly install_scripts dir
detected CPU cores: 2
configured CFLAGS: -O2 -I. -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -DUWSGI_HAS_IFADDRS -DUWSGI_ZLIB -DUWSGI_LOCK_USE_MUTEX -DUWSGI_EVENT_USE_EPOLL -DUWSGI_EVENT_TIMER_USE_TIMERFD -DUWSGI_EVENT_FILEMONITOR_USE_INOTIFY -DUWSGI_VERSION="\"2.0.20\"" -DUWSGI_VERSION_BASE="2" -DUWSGI_VERSION_MAJOR="0" -DUWSGI_VERSION_MINOR="20" -DUWSGI_VERSION_REVISION="0" -DUWSGI_VERSION_CUSTOM="\"\"" -DUWSGI_YAML -DUWSGI_SSL -DUWSGI_XML -DUWSGI_XML_EXPAT -DUWSGI_PLUGIN_DIR="\".\"" -DUWSGI_DECLARE_EMBEDDED_PLUGINS="UDEP(python);UDEP(gevent);UDEP(ping);UDEP(cache);UDEP(nagios);UDEP(rrdtool);UDEP(carbon);UDEP(rpc);UDEP(corerouter);UDEP(fastrouter);UDEP(http);UDEP(ugreen);UDEP(signal);UDEP(syslog);UDEP(rsyslog);UDEP(logsocket);UDEP(router_uwsgi);UDEP(router_redirect);UDEP(router_basicauth);UDEP(zergpool);UDEP(redislog);UDEP(mongodblog);UDEP(router_rewrite);UDEP(router_http);UDEP(logfile);UDEP(router_cache);UDEP(rawrouter);UDEP(router_static);UDEP(sslrouter);UDEP(spooler);UDEP(cheaper_busyness);UDEP(symcall);UDEP(transformation_tofile);UDEP(transformation_gzip);UDEP(transformation_chunked);UDEP(transformation_offload);UDEP(router_memcached);UDEP(router_redis);UDEP(router_hash);UDEP(router_expires);UDEP(router_metrics);UDEP(transformation_template);UDEP(stats_pusher_socket);" -DUWSGI_LOAD_EMBEDDED_PLUGINS="ULEP(python);ULEP(gevent);ULEP(ping);ULEP(cache);ULEP(nagios);ULEP(rrdtool);ULEP(carbon);ULEP(rpc);ULEP(corerouter);ULEP(fastrouter);ULEP(http);ULEP(ugreen);ULEP(signal);ULEP(syslog);ULEP(rsyslog);ULEP(logsocket);ULEP(router_uwsgi);ULEP(router_redirect);ULEP(router_basicauth);ULEP(zergpool);ULEP(redislog);ULEP(mongodblog);ULEP(router_rewrite);ULEP(router_http);ULEP(logfile);ULEP(router_cache);ULEP(rawrouter);ULEP(router_static);ULEP(sslrouter);ULEP(spooler);ULEP(cheaper_busyness);ULEP(symcall);ULEP(transformation_tofile);ULEP(transformation_gzip);ULEP(transformation_chunked);ULEP(transformation_offload);ULEP(router_memcached);ULEP(router_redis);ULEP(router_hash);ULEP(router_expires);ULEP(router_metrics);ULEP(transformation_template);ULEP(stats_pusher_socket);"
*** uWSGI compiling server core ***
[thread 1][x86_64-linux-gnu-gcc] core/utils.o
[thread 0][x86_64-linux-gnu-gcc] core/protocol.o
[thread 0][x86_64-linux-gnu-gcc] core/socket.o
[thread 0][x86_64-linux-gnu-gcc] core/logging.o
[thread 1][x86_64-linux-gnu-gcc] core/master.o
[thread 1][x86_64-linux-gnu-gcc] core/master_utils.o
[thread 0][x86_64-linux-gnu-gcc] core/emperor.o
[thread 1][x86_64-linux-gnu-gcc] core/notify.o
[thread 0][x86_64-linux-gnu-gcc] core/mule.o
[thread 1][x86_64-linux-gnu-gcc] core/subscription.o
[thread 0][x86_64-linux-gnu-gcc] core/stats.o
[thread 1][x86_64-linux-gnu-gcc] core/sendfile.o
[thread 0][x86_64-linux-gnu-gcc] core/async.o
[thread 1][x86_64-linux-gnu-gcc] core/master_checks.o
[thread 0][x86_64-linux-gnu-gcc] core/fifo.o
[thread 1][x86_64-linux-gnu-gcc] core/offload.o
[thread 0][x86_64-linux-gnu-gcc] core/io.o
[thread 1][x86_64-linux-gnu-gcc] core/static.o
[thread 1][x86_64-linux-gnu-gcc] core/websockets.o
[thread 0][x86_64-linux-gnu-gcc] core/spooler.o
[thread 1][x86_64-linux-gnu-gcc] core/snmp.o
[thread 0][x86_64-linux-gnu-gcc] core/exceptions.o
[thread 1][x86_64-linux-gnu-gcc] core/config.o
[thread 0][x86_64-linux-gnu-gcc] core/setup_utils.o
[thread 1][x86_64-linux-gnu-gcc] core/clock.o
[thread 0][x86_64-linux-gnu-gcc] core/init.o
[thread 1][x86_64-linux-gnu-gcc] core/buffer.o
[thread 0][x86_64-linux-gnu-gcc] core/reader.o
[thread 1][x86_64-linux-gnu-gcc] core/writer.o
[thread 0][x86_64-linux-gnu-gcc] core/alarm.o
[thread 1][x86_64-linux-gnu-gcc] core/cron.o
[thread 0][x86_64-linux-gnu-gcc] core/hooks.o
[thread 1][x86_64-linux-gnu-gcc] core/plugins.o
[thread 0][x86_64-linux-gnu-gcc] core/lock.o
[thread 1][x86_64-linux-gnu-gcc] core/cache.o
core/lock.c: In function ‘uwsgi_lock_fast_init’:
core/lock.c:114:17: warning: ‘pthread_mutexattr_setrobust_np’ is deprecated: pthread_mutexattr_setrobust_np is deprecated, use pthread_mutexattr_setrobust [-Wdeprecated-declarations]
114 | if (pthread_mutexattr_setrobust(&attr, PTHREAD_MUTEX_ROBUST)) {
| ^~
In file included from /usr/include/features.h:486,
from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from ./uwsgi.h:165,
from core/lock.c:1:
/usr/include/pthread.h:951:12: note: declared here
951 | extern int __REDIRECT_NTH (pthread_mutexattr_setrobust_np,
| ^~~~~~~~~~~~~~
core/lock.c: In function ‘uwsgi_lock_fast’:
core/lock.c:176:17: warning: ‘pthread_mutex_consistent_np’ is deprecated: pthread_mutex_consistent_np is deprecated, use pthread_mutex_consistent [-Wdeprecated-declarations]
176 | pthread_mutex_consistent((pthread_mutex_t *) uli->lock_ptr);
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/features.h:486,
from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from ./uwsgi.h:165,
from core/lock.c:1:
/usr/include/pthread.h:859:12: note: declared here
859 | extern int __REDIRECT_NTH (pthread_mutex_consistent_np, (pthread_mutex_t *),
| ^~~~~~~~~~~~~~
[thread 0][x86_64-linux-gnu-gcc] core/daemons.o
[thread 0][x86_64-linux-gnu-gcc] core/errors.o
[thread 1][x86_64-linux-gnu-gcc] core/hash.o
[thread 0][x86_64-linux-gnu-gcc] core/master_events.o
[thread 1][x86_64-linux-gnu-gcc] core/chunked.o
[thread 0][x86_64-linux-gnu-gcc] core/queue.o
[thread 1][x86_64-linux-gnu-gcc] core/event.o
[thread 0][x86_64-linux-gnu-gcc] core/signal.o
[thread 1][x86_64-linux-gnu-gcc] core/strings.o
[thread 0][x86_64-linux-gnu-gcc] core/progress.o
[thread 0][x86_64-linux-gnu-gcc] core/timebomb.o
[thread 1][x86_64-linux-gnu-gcc] core/ini.o
[thread 0][x86_64-linux-gnu-gcc] core/fsmon.o
[thread 1][x86_64-linux-gnu-gcc] core/mount.o
[thread 0][x86_64-linux-gnu-gcc] core/metrics.o
[thread 1][x86_64-linux-gnu-gcc] core/plugins_builder.o
core/metrics.c: In function ‘uwsgi_metric_set_max’:
core/metrics.c:706:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
706 | if (value > *um->value)
| ^~
In file included from core/metrics.c:1:
./uwsgi.h:436:27: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
436 | #define uwsgi_rwunlock(x) uwsgi.lock_ops.rwunlock(x)
| ^~~~~
core/metrics.c:708:9: note: in expansion of macro ‘uwsgi_rwunlock’
708 | uwsgi_rwunlock(uwsgi.metrics_lock);
| ^~~~~~~~~~~~~~
core/metrics.c: In function ‘uwsgi_metric_set_min’:
core/metrics.c:714:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
714 | if ((value > um->initial_value || 0) && value < *um->value)
| ^~
In file included from core/metrics.c:1:
./uwsgi.h:436:27: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
436 | #define uwsgi_rwunlock(x) uwsgi.lock_ops.rwunlock(x)
| ^~~~~
core/metrics.c:716:9: note: in expansion of macro ‘uwsgi_rwunlock’
716 | uwsgi_rwunlock(uwsgi.metrics_lock);
| ^~~~~~~~~~~~~~
[thread 1][x86_64-linux-gnu-gcc] core/sharedarea.o
[thread 0][x86_64-linux-gnu-gcc] core/rpc.o
[thread 1][x86_64-linux-gnu-gcc] core/gateway.o
[thread 0][x86_64-linux-gnu-gcc] core/loop.o
[thread 1][x86_64-linux-gnu-gcc] core/cookie.o
[thread 0][x86_64-linux-gnu-gcc] core/querystring.o
[thread 1][x86_64-linux-gnu-gcc] core/rb_timers.o
[thread 0][x86_64-linux-gnu-gcc] core/transformations.o
[thread 1][x86_64-linux-gnu-gcc] core/uwsgi.o
[thread 0][x86_64-linux-gnu-gcc] proto/base.o
[thread 0][x86_64-linux-gnu-gcc] proto/uwsgi.o
[thread 0][x86_64-linux-gnu-gcc] proto/http.o
[thread 0][x86_64-linux-gnu-gcc] proto/fastcgi.o
[thread 0][x86_64-linux-gnu-gcc] proto/scgi.o
[thread 1][x86_64-linux-gnu-gcc] proto/puwsgi.o
[thread 0][x86_64-linux-gnu-gcc] lib/linux_ns.o
[thread 1][x86_64-linux-gnu-gcc] core/zlib.o
[thread 1][x86_64-linux-gnu-gcc] core/yaml.o
[thread 0][x86_64-linux-gnu-gcc] core/ssl.o
core/ssl.c: In function ‘uwsgi_ssl_new_server_context’:
core/ssl.c:268:17: warning: ‘PEM_read_bio_DHparams’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
268 | DH *dh = PEM_read_bio_DHparams(bio, NULL, NULL, NULL);
| ^~
In file included from /usr/include/openssl/ssl.h:36,
from ./uwsgi.h:357,
from core/ssl.c:1:
/usr/include/openssl/pem.h:469:1: note: declared here
469 | DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, DHparams, DH)
| ^~~~~~~~~~~~~~~~~~~
core/ssl.c:273:25: warning: ‘DH_free’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
273 | DH_free(dh);
| ^~~~~~~
In file included from /usr/include/openssl/dsa.h:51,
from /usr/include/openssl/x509.h:37,
from /usr/include/openssl/ssl.h:31,
from ./uwsgi.h:357,
from core/ssl.c:1:
/usr/include/openssl/dh.h:200:28: note: declared here
200 | OSSL_DEPRECATEDIN_3_0 void DH_free(DH *dh);
| ^~~~~~~
core/ssl.c:279:9: warning: ‘EC_KEY_new_by_curve_name’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
279 | EC_KEY *ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
| ^~~~~~
In file included from /usr/include/openssl/x509.h:33,
from /usr/include/openssl/ssl.h:31,
from ./uwsgi.h:357,
from core/ssl.c:1:
/usr/include/openssl/ec.h:998:31: note: declared here
998 | OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_by_curve_name(int nid);
| ^~~~~~~~~~~~~~~~~~~~~~~~
core/ssl.c:283:17: warning: ‘EC_KEY_free’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
283 | EC_KEY_free(ecdh);
| ^~~~~~~~~~~
In file included from /usr/include/openssl/x509.h:33,
from /usr/include/openssl/ssl.h:31,
from ./uwsgi.h:357,
from core/ssl.c:1:
/usr/include/openssl/ec.h:1003:28: note: declared here
1003 | OSSL_DEPRECATEDIN_3_0 void EC_KEY_free(EC_KEY *key);
| ^~~~~~~~~~~
core/ssl.c: In function ‘uwsgi_sha1’:
core/ssl.c:563:9: warning: ‘SHA1_Init’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
563 | SHA1_Init(&sha);
| ^~~~~~~~~
In file included from /usr/include/openssl/x509.h:41,
from /usr/include/openssl/ssl.h:31,
from ./uwsgi.h:357,
from core/ssl.c:1:
/usr/include/openssl/sha.h:49:27: note: declared here
49 | OSSL_DEPRECATEDIN_3_0 int SHA1_Init(SHA_CTX *c);
| ^~~~~~~~~
core/ssl.c:564:9: warning: ‘SHA1_Update’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
564 | SHA1_Update(&sha, src, len);
| ^~~~~~~~~~~
In file included from /usr/include/openssl/x509.h:41,
from /usr/include/openssl/ssl.h:31,
from ./uwsgi.h:357,
from core/ssl.c:1:
/usr/include/openssl/sha.h:50:27: note: declared here
50 | OSSL_DEPRECATEDIN_3_0 int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
| ^~~~~~~~~~~
core/ssl.c:565:9: warning: ‘SHA1_Final’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
565 | SHA1_Final((unsigned char *)dst, &sha);
| ^~~~~~~~~~
In file included from /usr/include/openssl/x509.h:41,
from /usr/include/openssl/ssl.h:31,
from ./uwsgi.h:357,
from core/ssl.c:1:
/usr/include/openssl/sha.h:51:27: note: declared here
51 | OSSL_DEPRECATEDIN_3_0 int SHA1_Final(unsigned char *md, SHA_CTX *c);
| ^~~~~~~~~~
core/ssl.c: In function ‘uwsgi_md5’:
core/ssl.c:571:9: warning: ‘MD5_Init’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
571 | MD5_Init(&md5);
| ^~~~~~~~
In file included from core/ssl.c:4:
/usr/include/openssl/md5.h:49:27: note: declared here
49 | OSSL_DEPRECATEDIN_3_0 int MD5_Init(MD5_CTX *c);
| ^~~~~~~~
core/ssl.c:572:9: warning: ‘MD5_Update’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
572 | MD5_Update(&md5, src, len);
| ^~~~~~~~~~
In file included from core/ssl.c:4:
/usr/include/openssl/md5.h:50:27: note: declared here
50 | OSSL_DEPRECATEDIN_3_0 int MD5_Update(MD5_CTX *c, const void *data, size_t len);
| ^~~~~~~~~~
core/ssl.c:573:9: warning: ‘MD5_Final’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
573 | MD5_Final((unsigned char *)dst, &md5);
| ^~~~~~~~~
In file included from core/ssl.c:4:
/usr/include/openssl/md5.h:51:27: note: declared here
51 | OSSL_DEPRECATEDIN_3_0 int MD5_Final(unsigned char *md, MD5_CTX *c);
| ^~~~~~~~~
core/ssl.c: In function ‘uwsgi_sha1_2n’:
core/ssl.c:579:9: warning: ‘SHA1_Init’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
579 | SHA1_Init(&sha);
| ^~~~~~~~~
In file included from /usr/include/openssl/x509.h:41,
from /usr/include/openssl/ssl.h:31,
from ./uwsgi.h:357,
from core/ssl.c:1:
/usr/include/openssl/sha.h:49:27: note: declared here
49 | OSSL_DEPRECATEDIN_3_0 int SHA1_Init(SHA_CTX *c);
| ^~~~~~~~~
core/ssl.c:580:9: warning: ‘SHA1_Update’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
580 | SHA1_Update(&sha, s1, len1);
| ^~~~~~~~~~~
In file included from /usr/include/openssl/x509.h:41,
from /usr/include/openssl/ssl.h:31,
from ./uwsgi.h:357,
from core/ssl.c:1:
/usr/include/openssl/sha.h:50:27: note: declared here
50 | OSSL_DEPRECATEDIN_3_0 int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
| ^~~~~~~~~~~
core/ssl.c:581:9: warning: ‘SHA1_Update’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
581 | SHA1_Update(&sha, s2, len2);
| ^~~~~~~~~~~
In file included from /usr/include/openssl/x509.h:41,
from /usr/include/openssl/ssl.h:31,
from ./uwsgi.h:357,
from core/ssl.c:1:
/usr/include/openssl/sha.h:50:27: note: declared here
50 | OSSL_DEPRECATEDIN_3_0 int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
| ^~~~~~~~~~~
core/ssl.c:582:9: warning: ‘SHA1_Final’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
582 | SHA1_Final((unsigned char *)dst, &sha);
| ^~~~~~~~~~
In file included from /usr/include/openssl/x509.h:41,
from /usr/include/openssl/ssl.h:31,
from ./uwsgi.h:357,
from core/ssl.c:1:
/usr/include/openssl/sha.h:51:27: note: declared here
51 | OSSL_DEPRECATEDIN_3_0 int SHA1_Final(unsigned char *md, SHA_CTX *c);
| ^~~~~~~~~~
[thread 1][x86_64-linux-gnu-gcc] core/legion.o
[thread 0][x86_64-linux-gnu-gcc] core/xmlconf.o
[thread 0][x86_64-linux-gnu-gcc] core/dot_h.o
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> uwsgi
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
It says: "Using legacy 'setup.py install' for uwsgi, since package 'wheel' is not installed." So you can try to install wheel:
pip install wheel
Or you can install uwsgi with apt:
apt-get install uwsgi