Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uwsgi on mac catalina (10.15). #2109

Open
swuecho opened this issue Dec 27, 2019 · 7 comments
Open

uwsgi on mac catalina (10.15). #2109

swuecho opened this issue Dec 27, 2019 · 7 comments

Comments

@swuecho
Copy link

swuecho commented Dec 27, 2019

after upgrade to mac 10.15.2 (19C57). uwsgi fails. I reinstall using pip, but still no luck. There is no error msg, just do not work any more.

I wonder if uwsgi works on catalina or not. Thanks.

@sampullman
Copy link

I'm not sure if this is related, but I was unable to install uwsgi on OSX 10.15.3, the error was:

clang: error: no such file or directory: '<venv-dir>/lib/python3.7/config-3.7m/libpython3.7.a\'
*** error linking uWSGI ***

My temporary workaround is:

ln -s <venv-dir>/lib/python3.7/config-3.7m-darwin <venv-dir>/lib/python3.7/config-3.7m

@swuecho
Copy link
Author

swuecho commented Jan 30, 2020

thanks @sampullman. I migrate to use uwsgi in docker after hitting the wall too many times.

@richardcrichardc
Copy link

I have the same issue on Mac OS X Catalina:

(flask-hello) bash-3.2$ pip install uwsgi
Collecting uwsgi
  Using cached uwsgi-2.0.18.tar.gz (801 kB)
Building wheels for collected packages: uwsgi
...
...
...
    *** uWSGI linking ***
    clang -o /Users/richardc/.local/share/virtualenvs/flask-hello-BSeAq5-4/bin/uwsgi  core/utils.o core/protocol.o core/socket.o core/logging.o core/master.o core/master_utils.o core/emperor.o core/notify.o core/mule.o core/subscription.o core/stats.o core/sendfile.o core/async.o core/master_checks.o core/fifo.o core/offload.o core/io.o core/static.o core/websockets.o core/spooler.o core/snmp.o core/exceptions.o core/config.o core/setup_utils.o core/clock.o core/init.o core/buffer.o core/reader.o core/writer.o core/alarm.o core/cron.o core/hooks.o core/plugins.o core/lock.o core/cache.o core/daemons.o core/errors.o core/hash.o core/master_events.o core/chunked.o core/queue.o core/event.o core/signal.o core/strings.o core/progress.o core/timebomb.o core/ini.o core/fsmon.o core/mount.o core/metrics.o core/plugins_builder.o core/sharedarea.o core/rpc.o core/gateway.o core/loop.o core/cookie.o core/querystring.o core/rb_timers.o core/transformations.o core/uwsgi.o proto/base.o proto/uwsgi.o proto/http.o proto/fastcgi.o proto/scgi.o proto/puwsgi.o core/zlib.o core/yaml.o core/xmlconf.o core/dot_h.o core/config_py.o plugins/python/python_plugin.o plugins/python/pyutils.o plugins/python/pyloader.o plugins/python/wsgi_handlers.o plugins/python/wsgi_headers.o plugins/python/wsgi_subhandler.o plugins/python/web3_subhandler.o plugins/python/pump_subhandler.o plugins/python/gil.o plugins/python/uwsgi_pymodule.o plugins/python/profiler.o plugins/python/symimporter.o plugins/python/tracebacker.o plugins/python/raw.o plugins/gevent/gevent.o plugins/gevent/hooks.o plugins/ping/ping_plugin.o plugins/cache/cache.o plugins/nagios/nagios.o plugins/rrdtool/rrdtool.o plugins/carbon/carbon.o plugins/rpc/rpc_plugin.o plugins/corerouter/cr_common.o plugins/corerouter/cr_map.o plugins/corerouter/corerouter.o plugins/fastrouter/fastrouter.o plugins/http/http.o plugins/http/keepalive.o plugins/http/https.o plugins/http/spdy3.o plugins/signal/signal_plugin.o plugins/syslog/syslog_plugin.o plugins/rsyslog/rsyslog_plugin.o plugins/logsocket/logsocket_plugin.o plugins/router_uwsgi/router_uwsgi.o plugins/router_redirect/router_redirect.o plugins/router_basicauth/router_basicauth.o plugins/zergpool/zergpool.o plugins/redislog/redislog_plugin.o plugins/mongodblog/mongodblog_plugin.o plugins/router_rewrite/router_rewrite.o plugins/router_http/router_http.o plugins/logfile/logfile.o plugins/router_cache/router_cache.o plugins/rawrouter/rawrouter.o plugins/router_static/router_static.o plugins/sslrouter/sslrouter.o plugins/spooler/spooler_plugin.o plugins/cheaper_busyness/cheaper_busyness.o plugins/symcall/symcall_plugin.o plugins/transformation_tofile/tofile.o plugins/transformation_gzip/gzip.o plugins/transformation_chunked/chunked.o plugins/transformation_offload/offload.o plugins/router_memcached/router_memcached.o plugins/router_redis/router_redis.o plugins/router_hash/router_hash.o plugins/router_expires/expires.o plugins/router_metrics/plugin.o plugins/transformation_template/tt.o plugins/stats_pusher_socket/plugin.o -lpthread -lm -lz -lexpat -ldl -lSystem -framework CoreFoundation /Users/richardc/.local/share/virtualenvs/flask-hello-BSeAq5-4/lib/python3.7/config-3.7m/libpython3.7.a
    clang: error: no such file or directory: '/Users/richardc/.local/share/virtualenvs/flask-hello-BSeAq5-4/lib/python3.7/config-3.7m/libpython3.7.a'

/Users/richardc/.local/share/virtualenvs/flask-hello-BSeAq5-4/lib/python3.7/ exists but it does not contain config-3.7m/libpython3.7.a, only object file is readline.so.

I am out of my depth, but have the vague notion python-config can be used to find out how to link with libpython. This is what it tells me:

(flask-hello) bash-3.2$ python-config --ldflags
-L/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin -lpython3.7m -ldl -lSystem -framework CoreFoundation

@richardcrichardc
Copy link

Turns out ldflags from python-config were also incorrect.

which python3 outside the virtualenv returns /usr/bin/python3, which is included with Catalina.

I ran brew install python3, recreated the virtualenv, then pip install uwsgi worked.

@joshua-davis-rose
Copy link

Following this SO post finally helped me. The key was getting the path noted in the "Caveats" into my .bash_profile.

@gconcepcion
Copy link

Ran in to this issue also - as noted by @joshua-davis-rose -
No need to brew install an additional copy of python3

This solved my problem:

export PATH=/usr/local/opt/python/libexec/bin:$PATH

@OlehZakharchuk
Copy link

I just recreated virtualenv and it helped

xrmx pushed a commit that referenced this issue Oct 26, 2024
Under certain circumstances Py_ENABLE_SHARED would be False but the static library cannot be found. For example, if you use conda environments or if you use specific versions of MacOS #2109, #2270. pip install would fail in such a situation.

In this PR, we adjust the configurations so that the installation script would attempt to use shared library instead of the static one if no static library is found. This fixes pip install for Python 3.10.15 | packaged by conda-forge. It's not clear if this would fix the MacOS problems mentioned in the above issues though, as I am unable to verify those problems.
xrmx pushed a commit to xrmx/uwsgi that referenced this issue Oct 26, 2024
Under certain circumstances Py_ENABLE_SHARED would be False but the static library cannot be found. For example, if you use conda environments or if you use specific versions of MacOS unbit#2109, unbit#2270. pip install would fail in such a situation.

In this PR, we adjust the configurations so that the installation script would attempt to use shared library instead of the static one if no static library is found. This fixes pip install for Python 3.10.15 | packaged by conda-forge. It's not clear if this would fix the MacOS problems mentioned in the above issues though, as I am unable to verify those problems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants