Ssl error anaconda

Using conda in Windows Batch script exits early
  • Using conda in Windows Batch script exits early

  • NumPy MKL library load failed

  • SSL connection errors

  • Permission denied errors during installation

  • Permission denied errors after using sudo conda command

  • Already installed error message

  • Conda reports that a package is installed, but it appears not to be

  • pkg_resources.DistributionNotFound: conda==3.6.1-6-gb31b0d4-dirty

  • macOS error «ValueError unknown locale: UTF-8»

  • AttributeError or missing getproxies

  • Shell commands open from the wrong location

  • Programs fail due to invoking conda Python instead of system Python

  • UnsatisfiableSpecifications error

  • Package installation fails from a specific channel

  • Conda automatically upgrades to unwanted version

  • Conda upgrade error

  • ValidationError: Invalid value for timestamp

  • Unicode error after installing Python 2

  • Windows environment has not been activated

  • The system cannot find the path specified on Windows

Using conda in Windows Batch script exits early

In conda 4.6+, the way that you interact with conda goes through a batch script (%PREFIX%condabinconda.bat).
Unfortunately, this means it’s a little complicated to use conda from other batch scripts. When using batch
scripts from within batch scripts, you must prefix your command with CALL. If you do not do this, your batch
script that calls conda will exit immediately after the conda usage. In other words, if you write this in a .bat file:

conda create myenv python
conda activate myenv
echo test

Neither the activation, nor the echo will happen. You must write this in your batch script:

CALL conda create myenv python
CALL conda activate myenv
echo test

This is known behavior with cmd.exe, and we have not found any way to change it.
https://stackoverflow.com/questions/4798879/how-do-i-run-a-batch-script-from-within-a-batch-script/4798965

NumPy MKL library load failed

Error messages like

Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll

or

The ordinal 241 could not be located in the the dynamic link library

Cause

NumPy is unable to load the correct MKL or Intel OpenMP runtime libraries. This
is almost always caused by one of two things:

  1. The environment with NumPy has not been activated.

  2. Another software vendor has installed MKL or Intel OpenMP (libiomp5md.dll)
    files into the C:WindowsSystem32 folder. These files are being loaded
    before Anaconda’s and they’re not compatible.

Solution

If you are not activating your environments, start with doing that. There’s more
info at Activating environments. If you are still stuck, you may need to consider
more drastic measures.

  1. Remove any MKL-related files from C:WindowsSystem32. We recommend
    renaming them to add .bak to the filename to effectively hide them. Observe
    if any other software breaks. Try moving the DLL files alongside the .exe of
    the software that broke. If it works again, you can keep things in the
    moved state — Anaconda doesn’t need MKL in System32, and no other software should need it either. If
    you identify software that is installing software here, please contact the
    creators of that software. Inform them that their practice of installing
    MKL to a global location is fragile and is breaking other people’s software
    and wasting a lot of time. See the list of guilty parties below.

  2. You may try a special DLL loading mode that Anaconda builds into Python.
    This changes the DLL search path from System32 first to System32 as another
    entry on PATH, allowing libraries in your conda environment to be found
    before the libraries in System32. Control of this feature is done with
    environment variables. Only Python builds beyond these builds will react to
    these environment variables:

    • Python 2.7.15 build 14

    • Python 3.6.8 build 7

    • Python 3.7.2 build 8

    To update Python from the defaults channel:

    conda update -c defaults python
    

    Note

    Anaconda has built special patches into its builds of Python to enable
    this functionality. If you get your Python package from somewhere else
    (e.g. conda-forge), these flags may not do anything.

    Control environment variables:

    • CONDA_DLL_SEARCH_MODIFICATION_ENABLE

    • CONDA_DLL_SEARCH_MODIFICATION_DEBUG

    • CONDA_DLL_SEARCH_MODIFICATION_NEVER_ADD_WINDOWS_DIRECTORY

    • CONDA_DLL_SEARCH_MODIFICATION_NEVER_ADD_CWD

    To set variables on Windows, you may use either the CLI (Anaconda Prompt, for example) or a Windows GUI.

    • CLI: https://superuser.com/questions/79612/setting-and-getting-windows-environment-variables-from-the-command-prompt/79614

    • GUI: http://www.dowdandassociates.com/blog/content/howto-set-an-environment-variable-in-windows-gui/

    These should be set to a value of 1 to enable them. For example, in an Anaconda Prompt terminal:

    set CONDA_DLL_SEARCH_MODIFICATION_ENABLE=1
    

Note

Only CONDA_DLL_SEARCH_MODIFICATION_ENABLE should be set finally.

List of known software that installs Intel libraries to C:WindowsSystem32:

  • Amplitube, by IK Multimedia

  • ASIO4ALL, by Michael Tippach

If you find others, please let us know. If you’re on this list and you want to
fix things, let us know. In either case, the conda issue tracker at
https://github.com/conda/conda/issues is the best way to reach us.

SSL connection errors

This is a broad umbrella of errors with many causes. Here are some we’ve seen.

CondaHTTPError: HTTP 000 CONNECTION FAILED

If you’re on Windows and you see this error, look a little further down in the
error text. Do you see something like this?:

SSLError(MaxRetryError('HTTPSConnectionPool(host='repo.anaconda.com', port=443): Max retries exceeded with url: /pkgs/r/win-32/repodata.json.bz2 (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))'))

The key part there is the last bit:

Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")

Conda is having problems because it can’t find the OpenSSL libraries that it needs.

Cause

You may observe this error cropping up after a conda update. More recent
versions of conda and more recent builds of Python are more strict about
requiring activation of environments. We’re working on better error messages for
them, but here’s the story for now. Windows relies on the PATH environment
variable as the way to locate libraries that are not in the immediate folder,
and also not in the C:WindowsSystem32 folder. Searching for libraries in the
PATH folders goes from left to right. If you choose to put Anaconda’s folders on
PATH, there are several of them:

  • (install root)

  • (install root)/Library/mingw-w64/bin

  • (install root)/Library/usr/bin

  • (install root)/Library/bin

  • (install root)/Scripts

  • (install root)/bin

  • (install root)/condabin

Early installers for Anaconda put these on PATH. That was ultimately fragile
because Anaconda isn’t the only software on the system. If other software had
similarly named executables or libraries, and came earlier on PATH, Anaconda
could break. On the flip side, Anaconda could break other software if Anaconda
were earlier in the PATH order and shadowed any other executables or libraries.
To make this easier, we began recommending «activation» instead of modifying
PATH. Activation is a tool where conda sets your PATH, and also runs any custom
package scripts which are often used to set additional environment variables
that are necessary for software to run (e.g. JAVA_HOME). Because activation runs
only in a local terminal session (as opposed to the permanent PATH entry), it is
safe to put Anaconda’s PATH entries first. That means that Anaconda’s libraries
get higher priority when you’re running Anaconda but Anaconda doesn’t interfere
with other software when you’re not running Anaconda.

Anaconda’s Python interpreter included a patch for a long time that added the
(install root)/Library/bin folder to that Python’s PATH. Unfortunately, this
interfered with reasoning about PATH at all when using that Python interpreter.
We removed that patch in Python 3.7.0, and we regret that this has caused
problems for people who are not activating their environments and who otherwise
do not have the proper entries on PATH. We’re experimenting with approaches that
will allow our executables to be less dependent on PATH and more self-aware of
their needed library load paths. For now, though, the only solutions to this
problem are to manage PATH properly.

Our humble opinion is that activation is the easiest way to ensure that things
work. See more information on activation in Activating environments.

Solution

Use «Anaconda Prompt» or shells opened from Anaconda Navigator. If you use a GUI
IDE and you see this error, ask the developers of your IDE to add activation for
conda environments.

SSL certificate errors

Cause

Installing packages may produce a «connection failed» error if you do not have
the certificates for a secure connection to the package repository.

Solution

Pip can use the --trusted-host option to indicate that the URL of the
repository is trusted:

pip install --trusted-host pypi.org

Conda has three similar options.

  1. The option --insecure or -k ignores certificate validation errors for all hosts.

    Running conda create --help shows:

    Networking Options:
      -k, --insecure        Allow conda to perform "insecure" SSL connections and
                            transfers. Equivalent to setting 'ssl_verify' to
                            'False'.
    
  2. The configuration option ssl_verify can be set to False.

    Running conda config --describe ssl_verify shows:

    # # ssl_verify (bool, str)
    # #   aliases: verify_ssl
    # #   conda verifies SSL certificates for HTTPS requests, just like a web
    # #   browser. By default, SSL verification is enabled and conda operations
    # #   will fail if a required URL's certificate cannot be verified. Setting
    # #   ssl_verify to False disables certification verification. The value for
    # #   ssl_verify can also be (1) a path to a CA bundle file, or (2) a path
    # #   to a directory containing certificates of trusted CA.
    # #
    # ssl_verify: true
    

    Running conda config --set ssl_verify false modifies ~/.condarc and
    sets the -k flag for all future conda operations performed by that user.
    Running conda config --help shows other configuration scope options.

    When using conda config, the user’s conda configuration file at
    ~/.condarc is used by default. The flag --system will instead write
    to the system configuration file for all users at
    <CONDA_BASE_ENV>/.condarc. The flag --env will instead write to the
    active conda environment’s configuration file at
    <PATH_TO_ACTIVE_CONDA_ENV>/.condarc. If --env is used and no
    environment is active, the user configuration file is used.

  3. The configuration option ssl_verify can be used to install new certificates.

    Running conda config --describe ssl_verify shows:

    # # ssl_verify (bool, str)
    # #   aliases: verify_ssl
    # #   conda verifies SSL certificates for HTTPS requests, just like a web
    # #   browser. By default, SSL verification is enabled, and conda operations
    # #   will fail if a required URL's certificate cannot be verified. Setting
    # #   ssl_verify to False disables certification verification. The value for
    # #   ssl_verify can also be (1) a path to a CA bundle file, or (2) a path
    # #   to a directory containing certificates of trusted CA.
    # #
    # ssl_verify: true
    

    Your network administrator can give you a certificate bundle for your
    network’s firewall. Then ssl_verify can be set to the path of that
    certificate authority (CA) bundle and package installation operations will
    complete without connection errors.

    When using conda config, the user’s conda configuration file at
    ~/.condarc is used by default. The flag --system will instead write
    to the system configuration file for all users at
    <CONDA_BASE_ENV>/.condarc. The flag --env will instead write to the
    active conda environment’s configuration file at
    <PATH_TO_ACTIVE_CONDA_ENV>/.condarc. If --env is used and no
    environment is active, the user configuration file is used.

SSL verification errors

Cause

This error may be caused by lack of activation on Windows or expired
certifications:

SSL verification error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)

Solution

Make sure your conda is up-to-date: conda --version

If not, run: conda update conda

Temporarily set your ssl_verify variable to false, upgrade the requests package, and then
set ssl_verify back to true using the following commands:

conda config --set ssl_verify false
conda update requests
conda config --set ssl_verify true

You can also set ssl_verify to a string path to a certificate, which can be used to verify
SSL connections. Modify your .condarc and include the following:

ssl_verify: path-to-cert/chain/filename.ext

If the repository uses a self-signed certificate, use the actual path to the certificate.
If the repository is signed by a private certificate authority (CA), the file needs to include
the root certificate and any intermediate certificates.

Permission denied errors during installation

Cause

The umask command determines the mask settings that control
how file permissions are set for newly created files. If you
have a very restrictive umask, such as 077, you get
«permission denied» errors.

Solution

Set a less restrictive umask before calling conda commands.
Conda was intended as a user space tool, but often users need to
use it in a global environment. One place this can go awry is
with restrictive file permissions. Conda creates links when you
install files that have to be read by others on the system.

To give yourself full permissions for files and directories but
prevent the group and other users from having access:

  1. Before installing, set the umask to 007.

  2. Install conda.

  3. Return the umask to the original setting:

    umask 007
    conda install
    umask 077
    

For more information on umask, see
http://en.wikipedia.org/wiki/Umask.

Permission denied errors after using sudo conda command

Solution

Once you run conda with sudo, you must use sudo forever. We recommend that you NEVER run conda with sudo.

Already installed error message

Cause

If you are trying to fix conda problems without removing the
current installation and you try to reinstall Miniconda or
Anaconda to fix it, you get an error message that Miniconda
or Anaconda is already installed and you cannot continue.

Solution

Install using the --force option.

Download and install the appropriate Miniconda
for your operating system from the Miniconda download page using the force option
--force or -f:

bash Miniconda3-latest-MacOSX-x86_64.sh -f

Note

Substitute the appropriate filename and version for your
operating system.

Note

Be sure that you install to the same location as
your existing install so it overwrites the core conda files and
does not install a duplicate in a new folder.

Conda reports that a package is installed, but it appears not to be

Sometimes conda claims that a package is already installed but
it does not appear to be, for example, a Python package that
gives ImportError.

There are several possible causes for this problem, each with its
own solution.

Cause

You are not in the same conda environment as your package.

Solution

  1. Make sure that you are in the same conda environment as your
    package. The conda info command tells you what environment
    is currently active under default environment.

  2. Verify that you are using the Python from the correct
    environment by running:

    import sys
    
    print(sys.prefix)
    

Cause

For Python packages, you have set the PYTHONPATH or PYTHONHOME
variable. These environment variables cause Python to load files
from locations other than the standard ones. Conda works best
when these environment variables are not set, as their typical
use cases are obviated by conda environments and a common issue
is that they cause Python to pick up the wrong or broken
versions of a library.

Solution

For Python packages, make sure you have not set the PYTHONPATH
or PYTHONHOME variables. The command conda info -a displays
the values of these environment variables.

  • To unset these environment variables temporarily for the
    current terminal session, run unset PYTHONPATH.

  • To unset them permanently, check for lines in the files:

    • If you use bash—~/.bashrc, ~/.bash_profile,
      ~/.profile.

    • If you use zsh—~/.zshrc.

    • If you use PowerShell on Windows, the file output by
      $PROFILE.

Cause

You have site-specific directories or, for Python, you have
so-called site-specific files. These are typically located in
~/.local on macOS and Linux. For a full description of the locations of
site-specific packages, see PEP 370. As with
PYTHONPATH, Python may try importing packages from this
directory, which can cause issues.

Solution

For Python packages, remove site-specific directories and
site-specific files.

Cause

For C libraries, the following environment variables have been
set:

  • macOS—DYLD_LIBRARY_PATH.

  • Linux—LD_LIBRARY_PATH.

These act similarly to PYTHONPATH for Python. If they are
set, they can cause libraries to be loaded from locations other
than the conda environment. Conda environments obviate most use
cases for these variables. The command conda info -a shows
what these are set to.

Solution

Unset DYLD_LIBRARY_PATH or LD_LIBRARY_PATH.

Cause

Occasionally, an installed package becomes corrupted. Conda works
by unpacking the packages in the pkgs directory and then
hard-linking them to the environment. Sometimes these get
corrupted, breaking all environments that use them. They
also break any additional environments since the same files are hard-linked
each time.

Solution

Run the command conda install -f to unarchive the package
again and relink it. It also does an MD5 verification on the
package. Usually if this is different it is because your
channels have changed and there is a different package with the
same name, version, and build number.

Note

This breaks the links to any other environments that
already had this package installed, so you have to reinstall it
there, too. It also means that running conda install -f a lot
can use up significant disk space if you have many environments.

Note

The -f flag to conda install (--force) implies
--no-deps, so conda install -f package does not reinstall
any of the dependencies of package.

pkg_resources.DistributionNotFound: conda==3.6.1-6-gb31b0d4-dirty

Cause

The local version of conda needs updating.

Solution

Force reinstall conda. A useful way to work off the development
version of conda is to run python setup.py develop on a
checkout of the conda GitHub repository. However, if you are not
regularly running git pull, it is a good idea to un-develop,
as you will otherwise not get any regular updates to conda. The
normal way to do this is to run python setup.py develop -u.

However, this command does not replace the conda script
itself. With other packages, this is not an issue, as you can
just reinstall them with conda, but conda cannot be used if
conda is installed.

The fix is to use the ./bin/conda executable in the conda
git repository to force reinstall conda. That is, run
./bin/conda install -f conda. You can then verify with
conda info that you have the latest version of conda, and not
a git checkout. The version should not include any hashes.

macOS error «ValueError unknown locale: UTF-8″

Cause

This is a bug in the macOS Terminal app that shows up only in
certain locales. Locales are country-language combinations.

Solution

  1. Open Terminal in /Applications/Utilities

  2. Clear the Set locale environment variables on startup checkbox.

    ../_images/conda_locale.jpg

This sets your LANG environment variable to be empty. This may
cause Terminal to use incorrect settings for your locale. The
locale command in Terminal tells you what settings are used.

To use the correct language, add a line to your bash profile,
which is typically ~/.profile:

Note

Replace your-lang with the correct locale specifier for
your language.

The command locale -a displays all the specifiers. For
example, the language code for US English is en_US.UTF-8. The
locale affects what translations are used when they are available
and also how dates, currencies, and decimals are formatted.

AttributeError or missing getproxies

When running a command such as conda update ipython, you may
get an AttributeError: 'module' object has no attribute
'getproxies'
.

Cause

This can be caused by an old version of requests or by having
the PYTHONPATH environment variable set.

Solution

Update requests and be sure PYTHONPATH is not set:

  1. Run conda info -a to show the requests version and
    various environment variables such as PYTHONPATH.

  2. Update the requests version with
    pip install -U requests.

  3. Clear PYTHONPATH:

    • On Windows, clear it the environment variable settings.

    • On macOS and Linux, clear it by removing it from the bash
      profile and restarting the shell.

Shell commands open from the wrong location

When you run a command within a conda environment, conda does not
access the correct package executable.

Cause

In both bash and zsh, when you enter a command, the shell
searches the paths in PATH one by one until it finds the command.
The shell then caches the location, which is called hashing in
shell terminology. When you run command again, the shell does not
have to search the PATH again.

The problem is that before you installed the program, you ran a command which
loaded and hashed another version of that program in some other location on
the PATH, such as /usr/bin. Then you installed the program
using conda install, but the shell still had the old instance
hashed.

Solution

Reactivate the environment or run hash -r (in bash) or
rehash (in zsh).

When you run conda activate, conda automatically runs
hash -r in bash and rehash in zsh to clear the hashed
commands, so conda finds things in the new path on the PATH. But
there is no way to do this when conda install is run because
the command must be run inside the shell itself, meaning either
you have to run the command yourself or used a source file that
contains the command.

This is a relatively rare problem, since this happens only in the
following circumstances:

  1. You activate an environment or use the root environment, and
    then run a command from somewhere else.

  2. Then you conda install a program, and then try to run the
    program again without running activate or
    deactivate.

The command type command_name always tells you exactly what
is being run. This is better than which command_name, which
ignores hashed commands and searches the PATH directly.
The hash is reset by conda activate or by hash -r in bash or
rehash in zsh.

Programs fail due to invoking conda Python instead of system Python

Cause

After installing Anaconda or Miniconda, programs that run
python switch from invoking the system Python to invoking the
Python in the root conda environment. If these programs rely on
the system Python to have certain configurations or dependencies
that are not in the root conda environment Python, the programs
may crash. For example, some users of the Cinnamon desktop
environment on Linux Mint have reported these crashes.

Solution

Edit your .bash_profile and .bashrc files so that the
conda binary directory, such as ~/miniconda3/bin, is no
longer added to the PATH environment variable. You can still run
conda activate and conda deactivate by using their full
path names, such as ~/miniconda3/bin/conda.

You may also create a folder with symbolic links to conda activate
and conda deactivate and then edit your
.bash_profile or .bashrc file to add this folder to your
PATH. If you do this, running python will invoke the system
Python, but running conda commands, conda activate MyEnv,
conda activate root, or conda deactivate will work
normally.

After running conda activate to activate any environment,
including after running conda activate root, running
python will invoke the Python in the active conda environment.

UnsatisfiableSpecifications error

Cause

Some conda package installation specifications are impossible to
satisfy. For example, conda create -n tmp python=3 wxpython=3
produces an «Unsatisfiable Specifications» error because wxPython
3 depends on Python 2.7, so the specification to install Python 3
conflicts with the specification to install wxPython 3.

When an unsatisfiable request is made to conda, conda shows a
message such as this one:

The following specifications were found to be in conflict:
- python 3*
- wxpython 3* -> python 2.7*
Use ``conda search <package> --info`` to see the dependencies
for each package.

This indicates that the specification to install wxpython 3
depends on installing Python 2.7, which conflicts with the
specification to install Python 3.

Solution

Use conda search wxpython --info or conda search 'wxpython=3' --info
to show information about this package and its dependencies:

wxpython 3.0 py27_0
-------------------
file name   : wxpython-3.0-py27_0.tar.bz2
name        : wxpython
version     : 3.0
build number: 0
build string: py27_0
channel     : defaults
size        : 34.1 MB
date        : 2014-01-10
fn          : wxpython-3.0-py27_0.tar.bz2
license_family: Other
md5         : adc6285edfd29a28224c410a39d4bdad
priority    : 2
schannel    : defaults
url         : https://repo.continuum.io/pkgs/free/osx-64/wxpython-3.0-py27_0.tar.bz2
dependencies:
    python 2.7*
    python.app

By examining the dependencies of each package, you should be able
to determine why the installation request produced a conflict and
modify the request so it can be satisfied without conflicts. In
this example, you could install wxPython with Python 2.7:

conda create -n tmp python=2.7 wxpython=3

Package installation fails from a specific channel

Cause

Sometimes it is necessary to install a specific version from a
specific channel because that version is not available from the
default channel.

Solution

The following example describes the problem in detail and its
solution.

Suppose you have a specific need to install the Python
cx_freeze module with Python 3.4. A first step is to create a
Python 3.4 environment:

conda create -n py34 python=3.4

Using this environment you should first attempt:

conda install -n py34 cx_freeze

However, when you do this you get the following error:

Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata .........
Solving package specifications: .
Error: Package missing in current osx-64 channels:
- cx_freeze

You can search for packages on anaconda.org with

  anaconda search -t conda cx_freeze

The message indicates that cx_freeze cannot be found in the
default package channels. However, there may be a
community-created version available and you can search for it by
running the following command:

$ anaconda search -t conda cx_freeze
Using Anaconda Cloud api site https://api.anaconda.org
Run 'anaconda show <USER/PACKAGE>' to get more details:
Packages:
     Name                      |  Version | Package Types   | Platforms
     ------------------------- |   ------ | --------------- | ---------------
     inso/cx_freeze            |    4.3.3 | conda           | linux-64
     pyzo/cx_freeze            |    4.3.3 | conda           | linux-64, win-32, win-64, linux-32, osx-64
                                          : http://cx-freeze.sourceforge.net/
     silg2/cx_freeze           |    4.3.4 | conda           | linux-64
                                          : create standalone executables from Python scripts
     takluyver/cx_freeze       |    4.3.3 | conda           | linux-64
Found 4 packages

In this example, there are 4 different places that you could try
to get the package. None of them are officially supported or
endorsed by Anaconda, but members of the conda community have
provided many valuable packages. If you want to go with public
opinion, then the web interface provides more
information:

cx_freeze packages on anaconda.org

Notice that the pyzo organization has by far the most
downloads, so you might choose to use their package. If so, you
can add their organization’s channel by specifying it on the
command line:

$ conda create -c pyzo -n cxfreeze_py34 cx_freeze python=3.4
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ..........
Solving package specifications: .........

Package plan for installation in environment /Users/username/anaconda/envs/cxfreeze_py34:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    cx_freeze-4.3.3            |           py34_4         1.8 MB
    setuptools-20.7.0          |           py34_0         459 KB
    ------------------------------------------------------------
                                           Total:         2.3 MB

The following NEW packages will be INSTALLED:

    cx_freeze:  4.3.3-py34_4
    openssl:    1.0.2h-0
    pip:        8.1.1-py34_1
    python:     3.4.4-0
    readline:   6.2-2
    setuptools: 20.7.0-py34_0
    sqlite:     3.9.2-0
    tk:         8.5.18-0
    wheel:      0.29.0-py34_0
    xz:         5.0.5-1
    zlib:       1.2.8-0

Now you have a software environment sandbox created with Python
3.4 and cx_freeze.

Conda automatically upgrades to unwanted version

When making a Python package for an app, you create an
environment for the app from a file req.txt that sets a
certain version, such as python=2.7.9. However, when you
conda install your package, it automatically upgrades to a
later version, such as 2.7.10.

Cause

If you make a conda package for the app using conda-build, you
can set dependencies with specific version numbers. The
requirements lines that say - python could be
- python ==2.7.9 instead. It is important to have 1 space
before the == operator and no space after.

Solution

Exercise caution when coding version requirements.

Conda upgrade error

Cause

Downgrading conda from 4.6.1 to 4.5.x and then trying to conda install conda or conda upgrade conda will produce a solving and upgrade error similar to the following:

Solving environment: failed
CondaUpgradeError: This environment has previously been operated on by a conda version that's newer than the conda currently being used. A newer version of conda is required.
target environment location: /opt/conda
current conda version: 4.5.9
minimum conda version: 4.6

Solution

Change the .condarc file. Set the parameter by editing the .condarc file directly:
allow_conda_downgrades: true in conda version 4.5.12. This will then let you upgrade. If you have something older than 4.5.12, install conda 4.6.1 again from the package cache.

EXAMPLE: If my conda info says package cache : /opt/conda/pkgs and my Python version is 3.7, then on the command line, type conda install /opt/conda/pkgs/conda-4.6.1-py37_0.tar.bz2 to resolve the issue.

ValidationError: Invalid value for timestamp

Cause

This happens when certain packages are installed with conda 4.3.28, and then
conda is downgraded to 4.3.27 or earlier.

Solution

See https://github.com/conda/conda/issues/6096.

Unicode error after installing Python 2

Example: UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xd3 in position 1: ordinal not in range(128)

Cause

Python 2 is incapable of handling unicode properly, especially on Windows. In this case, if any character in your PATH env. var contains anything that is not ASCII then you see this exception.

Solution

Remove all non-ASCII from PATH or switch to Python 3.

Windows environment has not been activated

Cause

You may receive a warning message if you have not activated your environment:

Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment
please see https://conda.io/activation

Solution

If you receive this warning, you need to activate your environment.
To do so on Windows, use the Anaconda Prompt shortcut in your Windows
start menu. If you have an existing cmd.exe session that you’d like to
activate conda in, run:
call <your anaconda/miniconda install location>Scriptsactivate base.

The system cannot find the path specified on Windows

Cause

PATH does not contain entries for all of the necessary conda directories.
PATH may have too many entries from 3rd party software adding itself to
PATH at install time, despite the user not needing to run the software via PATH lookup.

Solution

Strip PATH to have fewer entries and activate your environment.

If there’s some software that needs to be found on PATH (you run it via
the CLI), we recommend that you create your own batch files to set PATH
dynamically within a console session, rather than permanently modifying
PATH in the system settings.

For example, a new conda prompt batch file that first strips PATH, then
calls the correct activation procedure could look like:

set
PATH=”%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;%SYSTEMROOT%System32WindowsPowerShellv1.0;<3rd-party-entries>”
call “<miniconda/anaconda root>Scriptsactivate”

If you need to run 3rd party software (software other than Windows
built-ins and Anaconda) from this custom conda prompt, then you should add
those entries (and only those strictly necessary) to the set PATH entry
above. Note that only the quotes wrapping the entire expression should be
there. That is how variables are properly set in batch scripts, and these
account for any spaces in any entries in PATH. No additional quotes should
be within the value assigned to PATH.

To make 3rd party software take precedence over the same-named programs
as supplied by conda, add it to PATH after activating conda:

set
“PATH=%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;%SYSTEMROOT%System32WindowsPowerShellv1.0”
call “<miniconda/anaconda root>Scriptsactivate”
set “PATH=<3rd-party-entries>;%PATH%”

To make conda software take precedence, call the activation script last.
Because activation prepends the conda environment PATH entries,
they have priority.

set
PATH=”%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;%SYSTEMROOT%System32WindowsPowerShellv1.0;<3rd-party-entries>”
call “<miniconda/anaconda root>Scriptsactivate”

During the process of python development, I meet the SSLError Can’t connect to HTTPS URL because the SSL module is not available in several cases. In this article, I will tell you how to reproduce and fix this error with examples.

1. Case1: Meet The Error When Executing Pip Install Command In Eclipse.

  1. I want to import the python pandas module in my python source code, when I run the python source code in the Eclipse PyDev project, it shows an error on the line of the source code import pandas as pd.
  2. The error message is Unresolved import: pd. This means that the python interpreter which I used in my eclipse PyDev project does not install the pandas module.

1.1 Steps To Reproduce The Can’t Connect To HTTPS URL Because The SSL Module Is Not Available Error.

  1. I follow the article How To Install Python Library ( such as Pandas ) In PyCharm, PyDev Eclipse to install the python pandas library in my Eclipse PyDev project.
  2. When I run the command install pandas in the Manage pip window ( please refer to the above article section 2.2 ), it shows the bellow error message in the text area under the Command to execute input text box.
    WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pandas/
    WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pandas/
    WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pandas/
    WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pandas/
    WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pandas/
    ERROR: Could not find a version that satisfies the requirement pandas (from versions: none)
    ERROR: No matching distribution found for pandas
    Could not fetch URL https://pypi.org/simple/pandas/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pandas/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
    FINISHED
  3. This error confused me a lot of time, but after investigating, I finally find the method to fix it.

1.2 How To Fix The Can’t Connect To HTTPS URL Because The SSL Module Is Not Available Error.

  1. I use the Anaconda in my example, and my python interpreter is an anaconda virtual environment also.
  2. First I open a dos window and run the command conda info to get the Anaconda basic information such as the Anaconda home directory ( it is C:Userszhaosonganaconda3 in this example ).
    C:Userszhaosong>conda info
    
         active environment : None
           user config file : C:Userszhaosong.condarc
     populated config files : C:Userszhaosong.condarc
              conda version : 4.10.1
        conda-build version : 3.20.5
             python version : 3.8.5.final.0
           virtual packages : __win=0=0
                              __archspec=1=x86_64
           base environment : C:Userszhaosonganaconda3  (writable)
          conda av data dir : C:Userszhaosonganaconda3etcconda
      conda av metadata url : https://repo.anaconda.com/pkgs/main
               channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                              https://repo.anaconda.com/pkgs/main/noarch
                              https://repo.anaconda.com/pkgs/r/win-64
                              https://repo.anaconda.com/pkgs/r/noarch
                              https://repo.anaconda.com/pkgs/msys2/win-64
                              https://repo.anaconda.com/pkgs/msys2/noarch
              package cache : C:Userszhaosonganaconda3pkgs
                              C:Userszhaosong.condapkgs
                              C:UserszhaosongAppDataLocalcondacondapkgs
           envs directories : C:Userszhaosonganaconda3envs
                              C:Userszhaosong.condaenvs
                              C:UserszhaosongAppDataLocalcondacondaenvs
                   platform : win-64
                 user-agent : conda/4.10.1 requests/2.24.0 CPython/3.8.5 Windows/10 Windows/10.0.19041
              administrator : False
                 netrc file : None
               offline mode : False
  3. I add the below 3 paths to my Windows Path environment variable value, then the error is fixed. You should use your own Anaconda path value to replace the one in my example. You can refer to the article How To Set Windows Environment Variables to learn more.
    C:Userszhaosonganaconda3
    
    C:Userszhaosonganaconda3Scripts
    
    C:Userszhaosonganaconda3Librarybin

2. Case 2: Meet The Error When Using Python Urllib3 To Get Webpage Html With HTTPS URL.

  1. When I use the python module urllib3 to retrieve a webpage Html source code using an HTTPS web page URL, it also throws an error like the above.
  2. Below is the detailed error stack trace.
    Exception has occurred: MaxRetryError
    HTTPSConnectionPool(host='www.bing.com', port=443): Max retries exceeded with url: / (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))
  3. In this case, I also use anaconda as the python environment and the editor is visual studio code, and after I add the below 3 strings in the windows PATH system environment variable, the error is fixed also, you can refer to section 1.2 of this article to get the detailed explanation.
    C:Userszhaosonganaconda3
    
    C:Userszhaosonganaconda3Scripts
    
    C:Userszhaosonganaconda3Librarybin

I’m trying to connect to Stripe to setup payments. I have it working on my dev machine, but when I push to prod, I get the following SSL error:

Can’t connect to HTTPS URL because the SSL module is not available.

Here are the details of my setup:

  • Ubuntu 16.04
  • Apache 2
  • mod_wsgi
  • Python 3.6
  • Django 1.11
  • Python/django processes are all installed and running in an anaconda (miniconda) virtual environment called «protectyourreviews»

I’ve read multiple other SO answers that suggest reinstalling python, but to be sure to install dependencies first. That shouldn’t be an issue when installing inside and anaconda environment should it? Shouldn’t anaconda take care of all of the dependencies for me?

I have HTTPS enabled and working for the entire domain (all requests are routed to https). When I check my install, I do have openssl, and when I open a shell in my django environment, I can import and use the module without issue… so I’m not sure how to continue troubleshooting the issue.

Any help is much appreciated!


Also, heres a stack trace:

File "/home/user/miniconda3/envs/protectyourreviews/lib/python3.6/site-packages/urllib3/connectionpool.py" in urlopen
  589.             conn = self._get_conn(timeout=pool_timeout)

File "/home/user/miniconda3/envs/protectyourreviews/lib/python3.6/site-packages/urllib3/connectionpool.py" in _get_conn
  251.         return conn or self._new_conn()

File "/home/user/miniconda3/envs/protectyourreviews/lib/python3.6/site-packages/urllib3/connectionpool.py" in _new_conn
  827.             raise SSLError("Can't connect to HTTPS URL because the SSL "

During handling of the above exception (Can't connect to HTTPS URL because the SSL module is not available.), another exception occurred:

File "/home/user/miniconda3/envs/protectyourreviews/lib/python3.6/site-packages/requests/adapters.py" in send
  440.                     timeout=timeout

File "/home/user/miniconda3/envs/protectyourreviews/lib/python3.6/site-packages/urllib3/connectionpool.py" in urlopen
  639.                                         _stacktrace=sys.exc_info()[2])

File "/home/user/miniconda3/envs/protectyourreviews/lib/python3.6/site-packages/urllib3/util/retry.py" in increment
  388.             raise MaxRetryError(_pool, url, error or ResponseError(cause))

During handling of the above exception (HTTPSConnectionPool(host='api.stripe.com', port=443): Max retries exceeded with url: /v1/customers (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",))), another exception occurred:

File "/home/user/miniconda3/envs/protectyourreviews/lib/python3.6/site-packages/stripe/http_client.py" in request
  121.                                                **kwargs)

File "/home/user/miniconda3/envs/protectyourreviews/lib/python3.6/site-packages/requests/sessions.py" in request
  508.         resp = self.send(prep, **send_kwargs)

File "/home/user/miniconda3/envs/protectyourreviews/lib/python3.6/site-packages/requests/sessions.py" in send
  618.         r = adapter.send(request, **kwargs)

File "/home/user/miniconda3/envs/protectyourreviews/lib/python3.6/site-packages/requests/adapters.py" in send
  506.                 raise SSLError(e, request=request)

During handling of the above exception (HTTPSConnectionPool(host='api.stripe.com', port=443): Max retries exceeded with url: /v1/customers (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",))), another exception occurred:

File "/home/user/miniconda3/envs/protectyourreviews/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
  41.             response = get_response(request)

File "/home/user/miniconda3/envs/protectyourreviews/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "/home/user/miniconda3/envs/protectyourreviews/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/home/user/miniconda3/envs/protectyourreviews/lib/python3.6/site-packages/django/views/decorators/csrf.py" in wrapped_view
  58.         return view_func(*args, **kwargs)

File "/home/user/miniconda3/envs/protectyourreviews/lib/python3.6/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  23.                 return view_func(request, *args, **kwargs)

File "/home/user/protectyourreviews/protectyourreviews/../payments/views.py" in stripe_test
  35.                 source=token

File "/home/user/miniconda3/envs/protectyourreviews/lib/python3.6/site-packages/stripe/resource.py" in create
  467.         response, api_key = requestor.request('post', url, params, headers)

File "/home/user/miniconda3/envs/protectyourreviews/lib/python3.6/site-packages/stripe/api_requestor.py" in request
  150.             method.lower(), url, params, headers)

File "/home/user/miniconda3/envs/protectyourreviews/lib/python3.6/site-packages/stripe/api_requestor.py" in request_raw
  335.             method, abs_url, headers, post_data)

File "/home/user/miniconda3/envs/protectyourreviews/lib/python3.6/site-packages/stripe/http_client.py" in request
  139.             self._handle_request_error(e)

File "/home/user/miniconda3/envs/protectyourreviews/lib/python3.6/site-packages/stripe/http_client.py" in _handle_request_error
  159.         raise error.APIConnectionError(msg)

Exception Type: APIConnectionError at /payments/test/stripe/
Exception Value: Unexpected error communicating with Stripe.  If this problem persists,
let us know at [email protected]

(Network error: SSLError: HTTPSConnectionPool(host='api.stripe.com', port=443): Max retries exceeded with url: /v1/customers (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)))

Edit


After re-instaling mod_wsgi in a fresh python virtualenv, it’s still trying to open the old anaconda path. I’ve changed the python-home and python-path directives in WSGIDaemonProcess, but no matter what I try, it’s still trying to open python from the miniconda3 directory (which I’ve deleted).

Here’s a trace from Apache error logs:

Current thread 0x00007f99f6769780 (most recent call first):
[Mon Aug 28 20:13:15.264466 2017] [core:notice] [pid 26528] AH00051: child pid 26775 exit signal Aborted (6), possible coredump in /etc/apache2
[Mon Aug 28 20:13:15.264608 2017] [core:notice] [pid 26528] AH00051: child pid 26776 exit signal Aborted (6), possible coredump in /etc/apache2
[Mon Aug 28 20:13:16.340556 2017] [wsgi:info] [pid 26789] mod_wsgi (pid=26789): Python home /home/user/miniconda3/envs/protectyourreviews.
[Mon Aug 28 20:13:16.341203 2017] [wsgi:warn] [pid 26789] (2)No such file or directory: mod_wsgi (pid=26789): Unable to stat Python home /home/user/miniconda3/envs/protectyourreviews. Python interpreter may not be a$
[Mon Aug 28 20:13:16.341357 2017] [wsgi:info] [pid 26789] mod_wsgi (pid=26789): Initializing Python.
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'

Edit 2


Yes, I did start from a clean source directory. I copied the mod_wsgi tar file to the new directory and ran configure/make/make install in the new directory. I believe I also deleted the apache module files before the new install just in case.

I’ve tried multiple iterations of the below directives (both / only python-home / only python-path) but no matter what I try, I can’t figure out why mod_wsgi keeps looking in the deleted miniconda3 folder. Is there some other config file that I’m forgetting about?

Here’s my wsgi.load:

LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so

Here are my Apache2 directives (where pyr_env is my new Python virtualenv folder):

WSGIDaemonProcess protectyourreviews python-home=/home/user/pyr_env/ python-path=/home/user/protectyourreviews
WSGIProcessGroup protectyourreviews

WSGIScriptAlias / /home/user/protectyourreviews/zz_test/test.wsgi
<Directory /home/user/protectyourreviews/zz_test>
        <Files test.wsgi>
                Require all granted
        </Files>
</Directory>

Edit 3


I followed the instructions you suggested in the docs, and the output follows.

Here’s the output of ldd:

$ ldd /usr/lib/apache2/modules/mod_wsgi.so
        linux-vdso.so.1 =>  (0x00007fffad973000)
        libpython3.5m.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0 (0x00007f05b8c02000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f05b89e5000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f05b861a000)
        libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f05b83f1000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f05b81d7000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f05b7fd2000)
        libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f05b7dcf000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f05b7ac6000)
        /lib64/ld-linux-x86-64.so.2 (0x0000558bed982000)

And here’s the output after unsetting LD_LIBRARY_PATH:

$ unset LD_LIBRARY_PATH
$ ldd /usr/lib/apache2/modules/mod_wsgi.so
        linux-vdso.so.1 =>  (0x00007ffd91bd2000)
        libpython3.5m.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0 (0x00007f8bec8a6000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f8bec689000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8bec2be000)
        libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f8bec095000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f8bebe7b000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f8bebc76000)
        libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f8beba73000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f8beb76a000)
        /lib64/ld-linux-x86-64.so.2 (0x000055e8861a5000)

Edit 4

I made sure permissions are set correctly on the virtual environment folder, and also recompiled again to be absolutely sure I have the correct version. Here’s all input and output from the process:

#----CHANGE PERMISSIONS OF VIRTUAL ENVIRONMENT
$ sudo chgrp -R www-data /home/user/pyr_env/
$ sudo chmod -R g+rwx /home/user/pyr_env/

#----DELETE OLD FOLDER
$ rm -r mod_wsgi-4.5.17/

#----START FRESH WITH CONFIG/MAKE/INSTALL
$ tar xvfz 4.5.17.tar.gz
$ cd mod_wsgi-4.5.17/
$ ./configure --with-python=/usr/bin/python3
$ make
$ sudo make install
    /usr/bin/apxs2 -i -S LIBEXECDIR=/usr/lib/apache2/modules -n 'mod_wsgi' src/server/mod_wsgi.la
    /usr/share/apache2/build/instdso.sh SH_LIBTOOL='/usr/share/apr-1.0/build/libtool' src/server/mod_wsgi.la /usr/lib/apache2/modules
    /usr/share/apr-1.0/build/libtool --mode=install install src/server/mod_wsgi.la /usr/lib/apache2/modules/
    libtool: install: install src/server/.libs/mod_wsgi.so /usr/lib/apache2/modules/mod_wsgi.so
    libtool: install: install src/server/.libs/mod_wsgi.lai /usr/lib/apache2/modules/mod_wsgi.la
    libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /usr/lib/apache2/modules
    ----------------------------------------------------------------------
    Libraries have been installed in:
       /usr/lib/apache2/modules

    If you ever happen to want to link against installed libraries
    in a given directory, LIBDIR, you must either use libtool, and
    specify the full pathname of the library, or use the `-LLIBDIR'
    flag during linking and do at least one of the following:
       - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
         during execution
       - add LIBDIR to the `LD_RUN_PATH' environment variable
         during linking
       - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
       - have your system administrator add LIBDIR to `/etc/ld.so.conf'

    See any operating system documentation about shared libraries for
    more information, such as the ld(1) and ld.so(8) manual pages.
    ----------------------------------------------------------------------
    chmod 644 /usr/lib/apache2/modules/mod_wsgi.so

#----OUTPUT OF LDD
$ ldd /usr/lib/apache2/modules/mod_wsgi.so
        linux-vdso.so.1 =>  (0x00007ffcfb9a9000)
        libpython3.5m.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0 (0x00007f19ae26f000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f19ae052000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f19adc87000)
        libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f19ada5e000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f19ad844000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f19ad63f000)
        libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f19ad43c000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f19ad133000)
        /lib64/ld-linux-x86-64.so.2 (0x000055aa1cb7a000)

#----RESTART APACHE
$ sudo apache2ctl restart

Unfortunately I’m seeing the exact same errors in Apache. Here’s apache2/error.log:

Current thread 0x00007fb350fee780 (most recent call first):
[Wed Aug 30 14:13:08.130076 2017] [core:notice] [pid 9754] AH00051: child pid 28636 exit signal Aborted (6), possible coredump in /etc/apache2
[Wed Aug 30 14:13:08.130179 2017] [core:error] [pid 9754] AH00546: no record of generation 0 of exiting child 28636
[Wed Aug 30 14:13:08.130833 2017] [wsgi:info] [pid 28639] mod_wsgi (pid=28639): Python home /home/user/miniconda3/envs/protectyourreviews.
[Wed Aug 30 14:13:08.130907 2017] [wsgi:warn] [pid 28639] (2)No such file or directory: mod_wsgi (pid=28639): Unable to stat Python home /home/user/minico$
[Wed Aug 30 14:13:08.130992 2017] [wsgi:info] [pid 28639] mod_wsgi (pid=28639): Initializing Python.
[Wed Aug 30 14:13:08.131665 2017] [wsgi:info] [pid 28638] mod_wsgi (pid=28638): Python home /home/user/miniconda3/envs/protectyourreviews.
[Wed Aug 30 14:13:08.131716 2017] [wsgi:warn] [pid 28638] (2)No such file or directory: mod_wsgi (pid=28638): Unable to stat Python home /home/user/minico$
[Wed Aug 30 14:13:08.131782 2017] [wsgi:info] [pid 28638] mod_wsgi (pid=28638): Initializing Python.
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'

It’s still trying to open the miniconda folder that was deleted…

I am trying to use anaconda on my windows issuse uvdos ssl laptop, got the ssl error, tried to «conda issuse uvdos ssl config —set ssl_verify false» and it makes issuse uvdos ssl no difference, any help or advise would be issuse uvdos ssl helpful.
$ issuse uvdos ssl C:ProgramDataAnaconda3Scriptsconda-script.py issuse uvdos ssl install -c conda-forge gdal`

Traceback (most recent call last):
  File "C:ProgramDataAnaconda3libsite-packagescondaexceptions.py", line 573, in conda_exception_handler
    return_value = func(*args, **kwargs)
  File "C:ProgramDataAnaconda3libsite-packagescondaclimain.py", line 134, in _main
    exit_code = args.func(args, p)
  File "C:ProgramDataAnaconda3libsite-packagescondaclimain_install.py", line 80, in execute
    install(args, parser, 'install')
  File "C:ProgramDataAnaconda3libsite-packagescondacliinstall.py", line 222, in install
    unknown=index_args['unknown'], prefix=prefix)
  File "C:ProgramDataAnaconda3libsite-packagescondacoreindex.py", line 92, in get_index
    index = fetch_index(channel_priority_map, use_cache=use_cache)
  File "C:ProgramDataAnaconda3libsite-packagescondacoreindex.py", line 111, in fetch_index
    repodatas = collect_all_repodata(use_cache, tasks)
  File "C:ProgramDataAnaconda3libsite-packagescondacorerepodata.py", line 74, in collect_all_repodata
    repodatas = _collect_repodatas_serial(use_cache, tasks)
  File "C:ProgramDataAnaconda3libsite-packagescondacorerepodata.py", line 463, in _collect_repodatas_serial
    for url, schan, pri in tasks]
  File "C:ProgramDataAnaconda3libsite-packagescondacorerepodata.py", line 463, in <listcomp>
    for url, schan, pri in tasks]
  File "C:ProgramDataAnaconda3libsite-packagescondacorerepodata.py", line 109, in func
    res = f(*args, **kwargs)
  File "C:ProgramDataAnaconda3libsite-packagescondacorerepodata.py", line 442, in fetch_repodata
    mod_etag_headers.get('_mod'))
  File "C:ProgramDataAnaconda3libsite-packagescondacorerepodata.py", line 138, in fetch_repodata_remote_request
    timeout=timeout)
  File "C:ProgramDataAnaconda3libsite-packagesrequestssessions.py", line 501, in get
    return self.request('GET', url, **kwargs)
  File "C:ProgramDataAnaconda3libsite-packagesrequestssessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "C:ProgramDataAnaconda3libsite-packagesrequestssessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "C:ProgramDataAnaconda3libsite-packagesrequestsadapters.py", line 423, in send
    timeout=timeout
  File "C:ProgramDataAnaconda3libsite-packagesrequestspackagesurllib3connectionpool.py", line 594, in urlopen
    chunked=chunked)
  File "C:ProgramDataAnaconda3libsite-packagesrequestspackagesurllib3connectionpool.py", line 350, in _make_request
    self._validate_conn(conn)
  File "C:ProgramDataAnaconda3libsite-packagesrequestspackagesurllib3connectionpool.py", line 835, in _validate_conn
    conn.connect()
  File "C:ProgramDataAnaconda3libsite-packagesrequestspackagesurllib3connection.py", line 323, in connect
    ssl_context=context)
  File "C:ProgramDataAnaconda3libsite-packagesrequestspackagesurllib3utilssl_.py", line 308, in ssl_wrap_socket
    context.load_verify_locations(ca_certs, ca_cert_dir)
  File "C:ProgramDataAnaconda3libsite-packagesrequestspackagesurllib3contribpyopenssl.py", line 392, in load_verify_locations
    self._ctx.load_verify_locations(cafile, capath)
  File "C:ProgramDataAnaconda3libsite-packagesOpenSSLSSL.py", line 525, in load_verify_locations
    _raise_current_error()
  File "C:ProgramDataAnaconda3libsite-packagesOpenSSL_util.py", line 48, in exception_from_error_queue
    raise exception_type(errors)
OpenSSL.SSL.Error: [('system library', 'fopen', 'Unknown error'), ('BIO routines', 'BIO_new_file', 'system lib'), ('x509 certificate routines', 'X509_load_cert_crl_file', 'system lib')]

30

Answers 1 : of why do I have ssl error while doing a conda install or simply run anaconda virtual environment

This has been fixed by uninstalling and questions uvdos ssl re-installing anaconda. It looks like questions uvdos ssl one of the pem is outdated.

0

2023-02-07T03:05:48+00:00 2023-02-07T03:05:48+00:00Answer Link

mRahman

Понравилась статья? Поделить с друзьями:
  • Ssl error access denied alert как исправить firefox
  • Ssl error 14094416
  • Ssl error 0x80090327 при обработке сертификата произошла неизвестная ошибка
  • Ssl error 0x80090308
  • Ssl error 0b080074 x509