unsupported hash type error while installing hashlib using pip3












6














I am trying to install the hashlib library for Python 3.6.0. Using pip3:



pip3 install hashlib


I get:



Collecting hashlib
Downloading hashlib-20081119.zip (42kB)
100% |████████████████████████████████| 51kB 1.6MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/__init__.py", line 10, in <module>
from setuptools.extern.six.moves import filter, filterfalse, map
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/extern/__init__.py", line 1, in <module>
from pkg_resources.extern import VendorImporter
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 36, in <module>
import email.parser
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/parser.py", line 12, in <module>
from email.feedparser import FeedParser, BytesFeedParser
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/feedparser.py", line 27, in <module>
from email._policybase import compat32
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/_policybase.py", line 9, in <module>
from email.utils import _has_surrogates
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/utils.py", line 28, in <module>
import random
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/random.py", line 46, in <module>
from hashlib import sha512 as _sha512
File "/private/var/folders/3m/q2pmrqbd2l9154yp_9ww5rjm0000gn/T/pip-build-1upkmzey/hashlib/hashlib.py", line 80
raise ValueError, "unsupported hash type"
^
SyntaxError: invalid syntax

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/3m/q2pmrqbd2l9154yp_9ww5rjm0000gn/T/pip-build-1upkmzey/hashlib/


Any idea on how to fix this? I am currently on macOS Sierra 10.12.6, using pip3 9.0.1 and python 3.6.










share|improve this question




















  • 5




    hashlib module is installed by default. No need to Install it, as you can see it has python 2.* coding syntax.
    – Bijoy
    Sep 9 '17 at 11:26










  • This solved it, thanks!
    – Lars S
    Sep 9 '17 at 11:46










  • @Bijoy I encounter the same problem. hashlib is included by default, I can import hashlib. But I can’t do from hashlib import blake2b. I know my code is working in two other environements but I have this error just now when trying to run it on a new fresh environnement. So far I have upgrade pip with pip3 install --upgrade pip, and then, trying to install hashlib fails with the same error as OP. I remember I have to install the hashlib module from pip, because the version which comes in my distro hasn’t this algorithm… Or should I use another ? 'BLAKE2b512', 'BLAKE2s256' ?
    – Stéphane
    Nov 11 at 3:13










  • @Bijoy : And my pip installation seems to be fine as I can install some other libs, like paramiko.
    – Stéphane
    Nov 11 at 3:20
















6














I am trying to install the hashlib library for Python 3.6.0. Using pip3:



pip3 install hashlib


I get:



Collecting hashlib
Downloading hashlib-20081119.zip (42kB)
100% |████████████████████████████████| 51kB 1.6MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/__init__.py", line 10, in <module>
from setuptools.extern.six.moves import filter, filterfalse, map
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/extern/__init__.py", line 1, in <module>
from pkg_resources.extern import VendorImporter
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 36, in <module>
import email.parser
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/parser.py", line 12, in <module>
from email.feedparser import FeedParser, BytesFeedParser
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/feedparser.py", line 27, in <module>
from email._policybase import compat32
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/_policybase.py", line 9, in <module>
from email.utils import _has_surrogates
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/utils.py", line 28, in <module>
import random
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/random.py", line 46, in <module>
from hashlib import sha512 as _sha512
File "/private/var/folders/3m/q2pmrqbd2l9154yp_9ww5rjm0000gn/T/pip-build-1upkmzey/hashlib/hashlib.py", line 80
raise ValueError, "unsupported hash type"
^
SyntaxError: invalid syntax

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/3m/q2pmrqbd2l9154yp_9ww5rjm0000gn/T/pip-build-1upkmzey/hashlib/


Any idea on how to fix this? I am currently on macOS Sierra 10.12.6, using pip3 9.0.1 and python 3.6.










share|improve this question




















  • 5




    hashlib module is installed by default. No need to Install it, as you can see it has python 2.* coding syntax.
    – Bijoy
    Sep 9 '17 at 11:26










  • This solved it, thanks!
    – Lars S
    Sep 9 '17 at 11:46










  • @Bijoy I encounter the same problem. hashlib is included by default, I can import hashlib. But I can’t do from hashlib import blake2b. I know my code is working in two other environements but I have this error just now when trying to run it on a new fresh environnement. So far I have upgrade pip with pip3 install --upgrade pip, and then, trying to install hashlib fails with the same error as OP. I remember I have to install the hashlib module from pip, because the version which comes in my distro hasn’t this algorithm… Or should I use another ? 'BLAKE2b512', 'BLAKE2s256' ?
    – Stéphane
    Nov 11 at 3:13










  • @Bijoy : And my pip installation seems to be fine as I can install some other libs, like paramiko.
    – Stéphane
    Nov 11 at 3:20














6












6








6







I am trying to install the hashlib library for Python 3.6.0. Using pip3:



pip3 install hashlib


I get:



Collecting hashlib
Downloading hashlib-20081119.zip (42kB)
100% |████████████████████████████████| 51kB 1.6MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/__init__.py", line 10, in <module>
from setuptools.extern.six.moves import filter, filterfalse, map
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/extern/__init__.py", line 1, in <module>
from pkg_resources.extern import VendorImporter
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 36, in <module>
import email.parser
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/parser.py", line 12, in <module>
from email.feedparser import FeedParser, BytesFeedParser
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/feedparser.py", line 27, in <module>
from email._policybase import compat32
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/_policybase.py", line 9, in <module>
from email.utils import _has_surrogates
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/utils.py", line 28, in <module>
import random
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/random.py", line 46, in <module>
from hashlib import sha512 as _sha512
File "/private/var/folders/3m/q2pmrqbd2l9154yp_9ww5rjm0000gn/T/pip-build-1upkmzey/hashlib/hashlib.py", line 80
raise ValueError, "unsupported hash type"
^
SyntaxError: invalid syntax

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/3m/q2pmrqbd2l9154yp_9ww5rjm0000gn/T/pip-build-1upkmzey/hashlib/


Any idea on how to fix this? I am currently on macOS Sierra 10.12.6, using pip3 9.0.1 and python 3.6.










share|improve this question















I am trying to install the hashlib library for Python 3.6.0. Using pip3:



pip3 install hashlib


I get:



Collecting hashlib
Downloading hashlib-20081119.zip (42kB)
100% |████████████████████████████████| 51kB 1.6MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/__init__.py", line 10, in <module>
from setuptools.extern.six.moves import filter, filterfalse, map
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/extern/__init__.py", line 1, in <module>
from pkg_resources.extern import VendorImporter
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 36, in <module>
import email.parser
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/parser.py", line 12, in <module>
from email.feedparser import FeedParser, BytesFeedParser
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/feedparser.py", line 27, in <module>
from email._policybase import compat32
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/_policybase.py", line 9, in <module>
from email.utils import _has_surrogates
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/utils.py", line 28, in <module>
import random
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/random.py", line 46, in <module>
from hashlib import sha512 as _sha512
File "/private/var/folders/3m/q2pmrqbd2l9154yp_9ww5rjm0000gn/T/pip-build-1upkmzey/hashlib/hashlib.py", line 80
raise ValueError, "unsupported hash type"
^
SyntaxError: invalid syntax

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/3m/q2pmrqbd2l9154yp_9ww5rjm0000gn/T/pip-build-1upkmzey/hashlib/


Any idea on how to fix this? I am currently on macOS Sierra 10.12.6, using pip3 9.0.1 and python 3.6.







python pip hashlib






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 9 '17 at 11:39

























asked Sep 9 '17 at 10:44









Lars S

609




609








  • 5




    hashlib module is installed by default. No need to Install it, as you can see it has python 2.* coding syntax.
    – Bijoy
    Sep 9 '17 at 11:26










  • This solved it, thanks!
    – Lars S
    Sep 9 '17 at 11:46










  • @Bijoy I encounter the same problem. hashlib is included by default, I can import hashlib. But I can’t do from hashlib import blake2b. I know my code is working in two other environements but I have this error just now when trying to run it on a new fresh environnement. So far I have upgrade pip with pip3 install --upgrade pip, and then, trying to install hashlib fails with the same error as OP. I remember I have to install the hashlib module from pip, because the version which comes in my distro hasn’t this algorithm… Or should I use another ? 'BLAKE2b512', 'BLAKE2s256' ?
    – Stéphane
    Nov 11 at 3:13










  • @Bijoy : And my pip installation seems to be fine as I can install some other libs, like paramiko.
    – Stéphane
    Nov 11 at 3:20














  • 5




    hashlib module is installed by default. No need to Install it, as you can see it has python 2.* coding syntax.
    – Bijoy
    Sep 9 '17 at 11:26










  • This solved it, thanks!
    – Lars S
    Sep 9 '17 at 11:46










  • @Bijoy I encounter the same problem. hashlib is included by default, I can import hashlib. But I can’t do from hashlib import blake2b. I know my code is working in two other environements but I have this error just now when trying to run it on a new fresh environnement. So far I have upgrade pip with pip3 install --upgrade pip, and then, trying to install hashlib fails with the same error as OP. I remember I have to install the hashlib module from pip, because the version which comes in my distro hasn’t this algorithm… Or should I use another ? 'BLAKE2b512', 'BLAKE2s256' ?
    – Stéphane
    Nov 11 at 3:13










  • @Bijoy : And my pip installation seems to be fine as I can install some other libs, like paramiko.
    – Stéphane
    Nov 11 at 3:20








5




5




hashlib module is installed by default. No need to Install it, as you can see it has python 2.* coding syntax.
– Bijoy
Sep 9 '17 at 11:26




hashlib module is installed by default. No need to Install it, as you can see it has python 2.* coding syntax.
– Bijoy
Sep 9 '17 at 11:26












This solved it, thanks!
– Lars S
Sep 9 '17 at 11:46




This solved it, thanks!
– Lars S
Sep 9 '17 at 11:46












@Bijoy I encounter the same problem. hashlib is included by default, I can import hashlib. But I can’t do from hashlib import blake2b. I know my code is working in two other environements but I have this error just now when trying to run it on a new fresh environnement. So far I have upgrade pip with pip3 install --upgrade pip, and then, trying to install hashlib fails with the same error as OP. I remember I have to install the hashlib module from pip, because the version which comes in my distro hasn’t this algorithm… Or should I use another ? 'BLAKE2b512', 'BLAKE2s256' ?
– Stéphane
Nov 11 at 3:13




@Bijoy I encounter the same problem. hashlib is included by default, I can import hashlib. But I can’t do from hashlib import blake2b. I know my code is working in two other environements but I have this error just now when trying to run it on a new fresh environnement. So far I have upgrade pip with pip3 install --upgrade pip, and then, trying to install hashlib fails with the same error as OP. I remember I have to install the hashlib module from pip, because the version which comes in my distro hasn’t this algorithm… Or should I use another ? 'BLAKE2b512', 'BLAKE2s256' ?
– Stéphane
Nov 11 at 3:13












@Bijoy : And my pip installation seems to be fine as I can install some other libs, like paramiko.
– Stéphane
Nov 11 at 3:20




@Bijoy : And my pip installation seems to be fine as I can install some other libs, like paramiko.
– Stéphane
Nov 11 at 3:20












1 Answer
1






active

oldest

votes


















0














As pointed out by Bijoy, there is no need to download the hashlib module as it is installed by default.



Simply use import hashlib to use it.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f46129813%2funsupported-hash-type-error-while-installing-hashlib-using-pip3%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    As pointed out by Bijoy, there is no need to download the hashlib module as it is installed by default.



    Simply use import hashlib to use it.






    share|improve this answer


























      0














      As pointed out by Bijoy, there is no need to download the hashlib module as it is installed by default.



      Simply use import hashlib to use it.






      share|improve this answer
























        0












        0








        0






        As pointed out by Bijoy, there is no need to download the hashlib module as it is installed by default.



        Simply use import hashlib to use it.






        share|improve this answer












        As pointed out by Bijoy, there is no need to download the hashlib module as it is installed by default.



        Simply use import hashlib to use it.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 12 at 18:37









        Lars S

        609




        609






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f46129813%2funsupported-hash-type-error-while-installing-hashlib-using-pip3%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            List item for chat from Array inside array React Native

            Jo Brand

            Thiostrepton