{"id":276,"hash":"ade8198fd5505de06cc2ceeb3aa5dfc7fc54741d04785f8458d74a2bc9900ac4","pattern":"&quot;AssertionError: Torch not compiled with CUDA enabled&quot; in spite upgrading to CUDA version","full_message":"I figured out this is a popular question, but still I couldn't find a solution for that.\n\nI'm trying to run a simple repository here which uses PyTorch. Although I just upgraded my PyTorch to the latest CUDA version from pytorch.org (1.2.0), it still throws the same error. I'm on Windows 10 and use Conda with Python 3.7.\n\n    raise AssertionError(\"Torch not compiled with CUDA enabled\")\n\nOutput:\n\nAssertionError: Torch not compiled with CUDA enabled\n\nHow can I fix the problem?\n\nHere is my conda list:\n\n# Name                    Version                   Build  Channel\n_ipyw_jlab_nb_ext_conf    0.1.0                    py37_0    anaconda\n_pytorch_select           1.1.0                       cpu    anaconda\n_tflow_select             2.3.0                       mkl    anaconda\nabsl-py                   0.7.1                    pypi_0    pypi\nalabaster                 0.7.12                   py37_0    anaconda\nanaconda                  2019.07                  py37_0    anaconda\nanaconda-client           1.7.2                    py37_0    anaconda\nanaconda-navigator        1.9.7                    py37_0    anaconda\nanaconda-project          0.8.3                      py_0    anaconda\nargparse                  1.4.0                    pypi_0    pypi\nasn1crypto                0.24.0                   py37_0    anaconda\nastor                     0.8.0                    pypi_0    pypi\nastroid                   2.2.5                    py37_0    anaconda\nastropy                   3.2.1            py37he774522_0    anaconda\natomicwrites              1.3.0                    py37_1    anaconda\nattrs                     19.1.0                   py37_1    anaconda\nbabel                     2.7.0                      py_0    anaconda\nbackcall                  0.1.0                    py37_0    anaconda\nbackports                 1.0                        py_2    anaconda\nbackports-csv             1.0.7                    pypi_0    pypi\nbackports-functools-lru-cache 1.5                      pypi_0    pypi\nbackports.functools_lru_cache 1.5                        py_2    anaconda\nbackports.os              0.1.1                    py37_0    anaconda\nbackports.shutil_get_terminal_size 1.0.0                    py37_2    anaconda\nbackports.tempfile        1.0                        py_1    anaconda\nbackports.weakref         1.0.post1                  py_1    anaconda\nbeautifulsoup4            4.7.1                    py37_1    anaconda\nbitarray                  0.9.3            py37he774522_0    anaconda\nbkcharts                  0.2                      py37_0    anaconda\nblas                      1.0                         mkl    anaconda\nbleach                    3.1.0                    py37_0    anaconda\nblosc                     1.16.3               h7bd577a_0    anaconda\nbokeh                     1.2.0                    py37_0    anaconda\nboto                      2.49.0                   py37_0    anaconda\nbottleneck                1.2.1            py37h452e1ab_1    anaconda\nbzip2                     1.0.8                he774522_0    anaconda\nca-certificates           2019.5.15                     0    anaconda\ncertifi                   2019.6.16                py37_0    anaconda\ncffi                      1.12.3           py37h7a1dbc1_0    anaconda\nchainer                   6.2.0                    pypi_0    pypi\nchardet                   3.0.4                    py37_1    anaconda\ncheroot                   6.5.5                    pypi_0    pypi\ncherrypy                  18.1.2                   pypi_0    pypi\nclick                     7.0                      py37_0    anaconda\ncloudpickle               1.2.1                      py_0    anaconda\nclyent                    1.2.2                    py37_1    anaconda\ncolorama                  0.4.1                    py37_0    anaconda\ncomtypes                  1.1.7                    py37_0    anaconda\nconda                     4.7.11                   py37_0    anaconda\nconda-build               3.18.9                   py37_3    anaconda\nconda-env                 2.6.0                         1    anaconda\nconda-package-handling    1.3.11                   py37_0    anaconda\nconda-verify              3.4.2                      py_1    anaconda\nconsole_shortcut          0.1.1                         3    anaconda\nconstants                 0.6.0                    pypi_0    pypi\ncontextlib2               0.5.5                    py37_0    anaconda\ncpuonly                   1.0                           0    pytorch\ncryptography              2.7              py37h7a1dbc1_0    anaconda\ncudatoolkit               10.0.130                      0    anaconda\ncurl                      7.65.2               h2a8f88b_0    anaconda\ncycler                    0.10.0                   py37_0    anaconda\ncython                    0.29.12          py37ha925a31_0    anaconda\ncytoolz                   0.10.0           py37he774522_0    anaconda\ndask                      2.1.0                      py_0    anaconda\ndask-core                 2.1.0                      py_0    anaconda\ndecorator                 4.4.0                    py37_1    anaconda\ndefusedxml                0.6.0                      py_0    anaconda\ndistributed               2.1.0                      py_0    anaconda\ndocutils                  0.14                     py37_0    anaconda\nentrypoints               0.3                      py37_0    anaconda\net_xmlfile                1.0.1                    py37_0    anaconda\nez-setup                  0.9                      pypi_0    pypi\nfastcache                 1.1.0            py37he774522_0    anaconda\nfasttext                  0.9.1                    pypi_0    pypi\nfeedparser                5.2.1                    pypi_0    pypi\nffmpeg                    4.1.3                h6538335_0    conda-forge\nfilelock                  3.0.12                     py_0    anaconda\nfirst                     2.0.2                    pypi_0    pypi\nf","ecosystem":"pypi","package_name":"pytorch","package_version":null,"solution":"You don't have to install it via anaconda, you could install cuda from their website. after install ends open a new terminal and check your cuda version with:\n\n>>> nvcc --version\nnvcc: NVIDIA (R) Cuda compiler driver\nCopyright (c) 2005-2021 NVIDIA Corporation\nBuilt on Thu_Nov_18_09:52:33_Pacific_Standard_Time_2021\nCuda compilation tools, release 11.5, V11.5.119\nBuild cuda_11.5.r11.5/compiler.30672275_0\n\nmy is V11.5\n\nthen go here and select your os and preferred package manager(pip or anaconda), and the cuda version you installed, and copy the generated install command, I got:\n\npip3 install torch==1.10.1+cu113 torchvision==0.11.2+cu113 torchaudio===0.10.1+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html\n\nnotice that for me I had python 3.10 installed but my project run over 3.9 so either use virtual environment or run pip of your wanted base interpreter explicitly (for example C:\\Software\\Python\\Python39\\python.exe -m pip install .....)\nelse you will be stuck with Could not find a version that satisfies the requirement torch errors\n\nthen open python console and check for cuda availability\n\n>>> import torch\n>>> torch.cuda.is_available()\nTrue","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/57814535/assertionerror-torch-not-compiled-with-cuda-enabled-in-spite-upgrading-to-cud","votes":105,"created_at":"2026-04-19T04:41:44.169284+00:00","updated_at":"2026-04-19T04:51:56.200657+00:00"}