pyenv / pyenv

Simple Python version management

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pyenv no module encoding issue

yoon9728 opened this issue · comments

Description

  • Platform information (e.g. Ubuntu Linux 16.04): amazon linux 2023
  • OS architecture (e.g. amd64): mac os
  • pyenv version: pyenv 2.3.35
  • Python version: 3.10
  • Please attach the debug trace of the failing command as a gist:
    Current thread 0x00007f2bd984a780 (most recent call first):

    [Tue Feb 06 08:16:18.438447 2024] [wsgi:warn] [pid 603909:tid 603909] (2)No such file or directory: mod_wsgi (pid=603909): Unable to stat Python home /home/ec2-user/.pyenv/3.10.0/envs/venv. Python interpreter may not be able to be initialized correctly. Verify the supplied path and access permissions for whole of the path.
    Python path configuration:
    PYTHONHOME = '/home/ec2-user/.pyenv/3.10.0/envs/venv'
    PYTHONPATH = (not set)
    program name = 'python3'
    isolated = 0
    environment = 1
    user site = 1
    import site = 1
    sys._base_executable = '/usr/bin/python3'
    sys.base_prefix = '/home/ec2-user/.pyenv/3.10.0/envs/venv'
    sys.base_exec_prefix = '/home/ec2-user/.pyenv/3.10.0/envs/venv'
    sys.platlibdir = 'lib'
    sys.executable = '/usr/bin/python3'
    sys.prefix = '/home/ec2-user/.pyenv/3.10.0/envs/venv'
    sys.exec_prefix = '/home/ec2-user/.pyenv/3.10.0/envs/venv'
    sys.path = [
    '/home/ec2-user/.pyenv/3.10.0/envs/venv/lib/python310.zip',
    '/home/ec2-user/.pyenv/3.10.0/envs/venv/lib/python3.10',
    '/home/ec2-user/.pyenv/3.10.0/envs/venv/lib/python3.10/lib-dynload',
    ]
    This is my error log

<VirtualHost *:80>
ServerName movie-night.ca
ServerAlias www.movie-night.ca

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://movie-night.ca/$1 [L,R=301]

<VirtualHost *:443>
ServerName movie-night.ca

SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/movie-night.ca/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/movie-night.ca/privkey.pem

DocumentRoot /home/ec2-user/MovieNight

Alias /static /home/ec2-user/MovieNight/static

<Directory /home/ec2-user/MovieNight/static>
    Require all granted
</Directory>

<Directory /home/ec2-user/MovieNight/movienight>
    <Files wsgi.py>
        Require all granted
    </Files>
</Directory>

WSGIDaemonProcess MovieNight python-path=/home/ec2-user/MovieNight python-home=/home/ec2-user/.pyenv/3.10.0/envs/venv
WSGIProcessGroup MovieNight
WSGIScriptAlias / /home/ec2-user/MovieNight/movienight/wsgi.py

LoadModule wsgi_module "/usr/lib64/httpd/modules/mod_wsgi-py310.cpython-310-x86_64-linux-gnu.so" WSGIPythonHome "/home/ec2-user/.pyenv/versions/3.10.0/envs/venv"

I set like this. I really don't know what this happening

  • sys._base_executable = '/usr/bin/python3'
    sys.base_prefix = '/home/ec2-user/.pyenv/3.10.0/envs/venv'

This isn't normal. How does that mod locate Python?

  • sys._base_executable = '/usr/bin/python3'
    sys.base_prefix = '/home/ec2-user/.pyenv/3.10.0/envs/venv'

This isn't normal. How does that mod locate Python?

Speaking of which: Why is Pyenv even activated for an service account that runs a web server?

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.