Can't install time module

前端 未结 8 1381
执念已碎
执念已碎 2021-01-04 02:31

I\'ve tried pip install time and sudo -H pip install time, but I keep getting the error:

Could not find a version that sati

相关标签:
8条回答
  • 2021-01-04 02:38

    time is pre-installed because when I import time "import time" everything goes well

    0 讨论(0)
  • 2021-01-04 02:40

    The time module is part of Python's standard library. It's installed along with the rest of Python, and you don't need to (nor can you!) install it with pip.

    I can import time in the Python Console

    Yes, because it's already installed.

    but not in my actual code

    I don't believe you. Show us the exact error message you get when you try.

    0 讨论(0)
  • 2021-01-04 02:45

    I think this is a PyCharm bug. I am using the time module with PyCharm and it complains that 'time' is an unresolved reference, even when I use

    import time
    

    at the beginning of my file. However, there is no run-time error when I execute my program, even though PyCharm does not recognise time as a valid module.

    0 讨论(0)
  • 2021-01-04 02:45

    I think I had the same problem, I think it's because one variable was called time...

    0 讨论(0)
  • 2021-01-04 02:45

    You should first import the library. So add a statement like: import

    0 讨论(0)
  • 2021-01-04 02:47

    I have also got the error, while referring the time on the 'requirements.txt' and pushing app to cloud foundry.

    So the errors is expected. So, its possible on other scenarios also. I just removed the time from the 'requirements.txt' before push my app to make it work.!

    0 讨论(0)
提交回复
热议问题