Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

`UnencryptedCookieSessionFactoryConfig` error when importing Apex

I'm trying to use Apex and whenever I try to import it (or anything involving it) I get the following traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/anaconda3/lib/python3.8/site-packages/apex/__init__.py", line 13, in <module>
    from pyramid.session import UnencryptedCookieSessionFactoryConfig
ImportError: cannot import name 'UnencryptedCookieSessionFactoryConfig' from 'pyramid.session' (unknown location)

I have the Pyramid library installed and importing that causes no issues. My Python version is 3.8.5 and my OS is Ubuntu 18.04.5.

I've tried searching online but haven't been able to find a satisfactory solution and was hoping to know if anyone who is familiar would be able to provide some tips on what the problem may be and what I can do. Thanks.

like image 589
Sean Avatar asked Mar 13 '21 05:03

Sean


3 Answers

I get the same issue if I use pip install apex.

It turns out that apex on pypi has nothing to do with NVIDIA's apex and is a totally unrelated, really old package.

To install NVIDIA's apex do:

git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --disable-pip-version-check --no-cache-dir \
--global-option="--cpp_ext" --global-option="--cuda_ext" ./

For more info see doc.

like image 136
stason Avatar answered Oct 22 '22 03:10

stason


The code below worked for me

git clone https://github.com/NVIDIA/apex
cd apex
python setup.py install
like image 24
sammens19 Avatar answered Oct 22 '22 01:10

sammens19


This will work:

pip uninstall apex
like image 41
Greg Tarr Avatar answered Oct 22 '22 01:10

Greg Tarr