samedi 21 mars 2020

Random library not working on fresh install of sublime text

So, I have a fresh install of Sublime text 3. If I use the random library I get errors, which aren't present when using other libraries such as numpy or math. However if I just use IDLE I have no problems. My spelling isn't great, but this didn't work even when I copied and pasted code I found online.

import random
random.seed(10)

if I use the random library at all I get the error(this holds true for every function I tried)

AttributeError: 'module' object has no attribute 'seed' if I use

import random
help(random)

I get

NAME random

FILE /Users/mynamehere/Documents/PythonProjects/random.py

Help on module random:

NAME random

FILE /Users/mynamehere/Documents/PythonProjects/random.py

However if I use any other library such as math or numpy I have no problems

import numpy as np
print(np.cos(np.pi))

This outputting

-1.0

btw: at this stage im kind of frustrated, and id accept recommendations of different IDEs to use(has to be cross platform Mac and Windows)




Aucun commentaire:

Enregistrer un commentaire