Меню

Pip install random ошибка

Let the code speak for itself:

    C:Usersthedi>pip install random

Collecting random
Could not find a version that satisfies the requirement random (from versions: )
No matching distribution found for random

    C:Usersthedi>import random

‘import’ is not recognized as an internal or external command,
operable program or batch file.

asked Jul 29, 2018 at 10:24

Maui Demigod of the Wind and S's user avatar

1

ERROR:

Could not find a version that satisfies the requirement random

ERROR:

No matching distribution found for random

if the above one is your error

then follow these steps-

Press

  • ctrl+f

  • in the following website,to search module https://www.lfd.uci.edu/~gohlke/pythonlibs

NOTE

check your python version before installing any module

After installing module copy and paste in your pip folder.

follow this path to paste your module in pip folder.

[C:UsersAdminAppDataLocalProgramsPythonPython38-32Scripts]

HOPE IT HELPS!

ZINE Mahmoud's user avatar

ZINE Mahmoud

1,2641 gold badge17 silver badges32 bronze badges

answered May 14, 2021 at 5:40

ANONYMOUS-'s user avatar

I was searching for the import «Random», none of the answers above worked but I made more research and got this. I’d be using Random as the module here.

If you’re getting:
«ERROR: Could not find a version that satisfies the requirement Random (from versions: none)
ERROR: No matching distribution found for Random», then you should check the python database here: https://pypi.org/ and search for the module you need.

If you see the module, copy the code to install the module into your shell/terminal, in this case I was copied the code for Random module which is «pip install random-string».

Make sure you’re connected to the internet, it should work.

answered Oct 11, 2022 at 23:32

2ceprince's user avatar

You first have to enter the Python console to run Python code.
Type «python» and press enter to use the console after you have installed Python.

Also, please note that random is a built-in module, so there’s no need to install it using pip, and that also might be why pip couldn’t locate that package.

guidot's user avatar

guidot

4,9012 gold badges24 silver badges37 bronze badges

answered Jul 29, 2018 at 10:26

Quit3Simpl3's user avatar

Quit3Simpl3Quit3Simpl3

1734 silver badges14 bronze badges

I am using python 2.7.4 and having a problem while running pip install random. It comes up with this error:

Collecting random
  Could not find a version that satisfies the requirement random (from versions: )
No matching distribution found for random

Can anyone help me out in this matter?

Results of pip install -vvv random # verbose output :

File "c:userssupport-ihsanapplibsite-packagespip_internalreqreq_install.py", line 307, in populate_link self.link = finder.find_requirement(self, upgrade) 

File "c:userssupport-ihsanapplibsite-packagespip_internalindex.py", line 533, in find_requirement 'No matching distribution found for %s' % req DistributionNotFound: No matching distribution found for random 

Zanna's user avatar

Zanna

68.1k55 gold badges209 silver badges319 bronze badges

asked May 16, 2018 at 10:08

ihsan saleem's user avatar

1

This mean that there no package with name random .

Also random module should be present by default . Cause this code works fine on machine with python2

  import random
  num = random.randint(10,20)
  print (num)

And I am too getting the same error when I type this command

pip install random

answered May 16, 2018 at 10:31

16

Я использую python 2.7.4 и имею проблему при запуске pip install random. Это вызывает ошибку:

Collecting random
Could not find a version that satisfies the requirement random (from versions: )
No matching distribution found for random

Может ли кто-нибудь помочь мне в этом вопросе?

Результаты pip install -vvv random # verbose output:

File "c:userssupport-ihsanapplibsite-packagespip_internalreqreq_install.py", line 307, in populate_link self.link = finder.find_requirement(self, upgrade)

File "c:userssupport-ihsanapplibsite-packagespip_internalindex.py", line 533, in find_requirement 'No matching distribution found for %s' % req DistributionNotFound: No matching distribution found for random

задан
16 May 2018 в 21:13

поделиться

2 ответа

Это означает, что нет пакета с именем random.

Также по умолчанию должен присутствовать случайный модуль. Причина, по которой этот код отлично работает на машине с python2

import random
num = random.randint(10,20)
print (num)

И я получаю ту же ошибку, когда я набираю эту команду

pip install random

ответ дан SmitTheLastFirefoxUser
17 July 2018 в 14:10

поделиться

Это означает, что нет пакета с именем random.

Также по умолчанию должен присутствовать случайный модуль. Причина, по которой этот код отлично работает на машине с python2

import random
num = random.randint(10,20)
print (num)

И я получаю ту же ошибку, когда я набираю эту команду

pip install random

ответ дан noone
20 July 2018 в 14:13

поделиться

Другие вопросы по тегам:

Похожие вопросы:

ERROR: Could not find a version that satisfies the requirement python-random (from versions: none)
ERROR: No matching distribution found for python-random

FLAK-ZOSO's user avatar

FLAK-ZOSO

3,7463 gold badges6 silver badges28 bronze badges

asked Apr 3, 2022 at 14:10

MR.TUSHAR SAMADHAN PATIL's user avatar

2

You don’t have to install the random module, since it’s a built-in module and it comes with the standard Python installation.


If you want to use its functions and classes, you just have to import it:

# main.py
import random
print(random.randint(0, 100)) # 42

answered Apr 3, 2022 at 14:21

FLAK-ZOSO's user avatar

FLAK-ZOSOFLAK-ZOSO

3,7463 gold badges6 silver badges28 bronze badges

ERROR: Could not find a version that satisfies the requirement python-random (from versions: none)
ERROR: No matching distribution found for python-random

FLAK-ZOSO's user avatar

FLAK-ZOSO

3,7463 gold badges6 silver badges28 bronze badges

asked Apr 3, 2022 at 14:10

MR.TUSHAR SAMADHAN PATIL's user avatar

2

You don’t have to install the random module, since it’s a built-in module and it comes with the standard Python installation.


If you want to use its functions and classes, you just have to import it:

# main.py
import random
print(random.randint(0, 100)) # 42

answered Apr 3, 2022 at 14:21

FLAK-ZOSO's user avatar

FLAK-ZOSOFLAK-ZOSO

3,7463 gold badges6 silver badges28 bronze badges

Sometimes you get an error when you’re trying to install a Python package
using pip. It looks like this:

Could not find a version that satisfies the requirement (from versions:)
No matching distribution found for

Some probable reasons for this error are:

  1. PyPI server isn’t responding to your requests. It can happen either because
    the PyPI server is down or because it has blacklisted your IP address. This
    happened to me once when I was trying installing packages on a server.
    This can be fixed by using a proxy with pip. See the solution below.

  2. You’re running an older pip (especially on Mac). This can be fixed by
    upgrading your pip.
    See this post on Stack Overflow.
    Thanks to Anupam Jain who pointed this in a comment.

  3. The package you’re trying to install is not available for your Python version.

  4. The package is not available for your operating system. This is a rare case
    and only happens when the package is not pure-Python, i.e. it’s been
    partially written in C or Cython. Such a package needs to be compiled for
    every operating system (Windows/Mac/Linux) and architecture (32-bit/64-bit).
    Suppose a package has only been compiled for Windows 64-bit, then you’ll get
    this error if you try to install it on Windows 32-bit, or any other
    OS.

  5. The package is not present on PyPI server. In this case pip will not work. So
    you’ll have to download and install the package manually from Github or wherever
    it is available.

Solution¶

I had this issue because PyPI server had blacklisted the IP
of my hosting provider, the obvious solution was to make pip install via a proxy.

But to see if that’s also the case with you, you can test it like this:

$ curl https://pypi.org

The requestors Network has been blacklisted due to excessive request volume. 
If you are a hosting customer, please contact your hosting company's support. 
If you are the hosting company, please contact infrastructure-staff@python.org to resolve

If you see the message similar to above, that means your IP has also been
blacklisted by https://pypi.org.

If you don’t see this message then the reason for the pip error could be that you’re using
an older version. See this post on Stack Overflow
for a solution.

Anyways, this can be fixed by using a proxy with pip.

Supplying a proxy address to pip is easy:

$ pip install -r requirements.txt --proxy address:port

Above, address and port are IP address and port of the proxy.

To find proxies, just search Google for proxy list.

Other things that I tried¶

These are some other things that I tried to get rid of this issue.
Although they didn’t work for me, but they might work for you.

  1. Changing DNS resolver of my server.
    This makes sense if your server’s DNS resolver can’t find PyPI servers.
  2. Reconfiguring SSL, reinstalling CA certificates.
    This makes sense if you don’t have updated CA certificates which are used by
    PyPI servers.
  3. Downloading packages using wget.
    This is an alternative way to install Python packages. Download them via wget
    and then install them using python setup.py install. In my case, the server was
    blacklisted by PyPI so I was getting a 403 Forbidden error.
  4. Downloading packages using curl.
    Alternative to wget. In my case I didn’t get a 403 error but rather it just
    created invalid tarball files, instead of actually downloading them.
  5. Downloading packages using git or hg.
    If your desired packages have git or hg repositories that you can clone, this
    is a good workaround.

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • P242a ошибка vw touareg
  • Pioneer ошибка 19 чтение usb