Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
699 votes
23 answers
2.0m views

How to install pip with Python 3?

I want to install pip. It should support Python 3, but it requires setuptools, which is available only for Python 2. How can I install pip with Python 3?
deamon's user avatar
  • 91.3k
438 votes
19 answers
1.1m views

Relative imports - ModuleNotFoundError: No module named x

This is the first time I've really sat down and tried python 3, and seem to be failing miserably. I have the following two files: test.py config.py config.py has a few functions defined in it as ...
blitzmann's user avatar
  • 7,645
426 votes
5 answers
206k views

Is __init__.py not required for packages in Python 3.3+

I am using Python 3.5.1. I read the document and the package section here: https://docs.python.org/3/tutorial/modules.html#packages Now, I have the following structure: /home/wujek/Playground/a/b/...
wujek's user avatar
  • 10.7k
77 votes
9 answers
35k views

How to upload new versions of project to PyPI with twine?

I've uploaded my Python package to PyPI. But now I made new version of my package and need to upload it. I tried to make same progress which I did when upload the package first time but I got the ...
Basel Akasha's user avatar
  • 1,228
73 votes
3 answers
22k views

Namespace vs regular package

What's the difference between a namespace Python package (no __init__.py) and a regular Python package (has an __init__.py), especially when __init__.py is empty for a regular package? I am curious ...
darkfeline's user avatar
  • 10.3k
43 votes
3 answers
4k views

`del` on a package has some kind of memory

del seems to have some memory which puzzles me. See the following: In [1]: import math In [2]: math.cos(0) Out[2]: 1.0 In [3]: del math.cos In [4]: math.cos(0) -------------------------------------...
Aguy's user avatar
  • 8,041
41 votes
7 answers
89k views

Pip Install hangs

I currently have Python 3.5 on my Windows machine. I'm trying to install a Python package using the command "pip install" but as soon as I hit enter nothing happens. The action hangs for ...
Waves's user avatar
  • 993
41 votes
4 answers
62k views

python: Two modules and classes with the same name under different packages

I have started to learn python and writing a practice app. The directory structure looks like src | --ShutterDeck | --Helper | --User.py -> class User --Controller ...
Mayank's user avatar
  • 5,628
33 votes
4 answers
75k views

Dependencies and packages conflicts in Anaconda?

I'm using Anaconda 5.1 and Python 3.6 on a Windows 10 machine. I'm having quite a few problems ; I tried to add some useful tools such as lightGBM, tensorflow, keras, bokeh,... to my conda ...
Nathan Furnal's user avatar
27 votes
2 answers
29k views

Install Python Package From Private Bitbucket Repo

I created a Python 3.5 package for work, which is in a private Bitbucket repo and I can easily pull the code and do a "python .\setup.py install" to have it install, but I want to try to eliminate the ...
Hososugi's user avatar
  • 380
25 votes
2 answers
12k views

Import a module from both within same package and from outside the package in Python 3

Okay, the scenario is very simple. I have this file structure: . ├── interface.py ├── pkg │   ├── __init__.py │   ├── mod1.py │   ├── mod2.py Now, these are my conditions: mod2 needs to import mod1....
Akronix's user avatar
  • 2,078
24 votes
7 answers
45k views

Installed a package with Anaconda, can't import in Python

Forgive me but I'm new to python. I've installed a package (theano) using conda install theano, and when I type conda list, the package exists However, when I enter the python interpreter by running ...
KDogg's user avatar
  • 445
22 votes
5 answers
99k views

(Python: discord.py) ERROR: Could not build wheels for multidict, yarl which use PEP 517 and cannot be installed directly

trying to download discord.py using pip install, gave me the error message in the title. I installed using cmd and the commands py -m pip install -U discord, the cmd was also run in admin. tried using ...
NickOfTime's user avatar
21 votes
3 answers
58k views

ModuleNotFoundError: No module named 'unidecode' yet I have the module installed

I am trying to remove accents from a Python list of strings by converting it from UTF-8 to ASCII. I have read answers to multiple questions here in StackOverflow that suggest using the unidecode ...
Felipe Ito's user avatar
20 votes
4 answers
20k views

pip install dryscrape fails with "error: [Errno 2] No such file or directory: 'src/webkit_server'"?

I need to install dryscrape for python but I got error, what's the problem? C:\Users\parvij\Anaconda3\Scripts>pip install dryscrape I got this: Collecting dryscrape Collecting webkit-server>=...
parvij's user avatar
  • 1,390
20 votes
2 answers
6k views

Register an internal package on Pypi

I read somewhere that if you make an internal Python package for proprietary work, you should still register the name on PyPi to avoid potential future dependency issues. How do I do this without ...
Dan's user avatar
  • 45.5k
20 votes
2 answers
11k views

pip Install Editable Package Produces ModuleNotFoundError

Due to import issues, I've followed the steps shown here to install my Python project as an editable pip package. Basically this entails running pip install -e . from my project root directory. The ...
ThoseKind's user avatar
  • 794
19 votes
4 answers
28k views

From request import PandaRequest ImportError: No module named 'request'

I am trying to use panda. When I import it as import panda as pd I get this error File "/usr/local/lib/python3.5/dist-packages/panda/__init__.py", line 1, in <module> from request import ...
Bruno's user avatar
  • 641
16 votes
5 answers
96k views

Installing python modules on Ubuntu

I need to install some modules for python on Ubuntu Linux 12.04. I want pygame and livewires but I'm not sure how to install them. I have the py file for livewires, which has been specially edited (...
Infamouslyuseless's user avatar
15 votes
2 answers
35k views

AttributeError: module '' has no attribute '__path__'

I'm having a problem which I have no idea how to further debug. I have a project with different purposes, making use of Python 3 among other things. I created a Python package named package. The ...
Blitzkoder's user avatar
  • 1,798
14 votes
2 answers
11k views

How to use from x import y using importlib in Python

I wanted to install and import a package from script. Then I wanted to add from x import y and from x import * in that script.(I was making some functions actually). I successfully installed and ...
Ratul Hasan's user avatar
12 votes
4 answers
61k views

Python - package not found although it is installed

I have the following version of python import sys print(sys.version) 3.6.5 | packaged by conda-forge | (default, Apr 6 2018, 13:44:09) [GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] I ...
ecjb's user avatar
  • 5,351
12 votes
3 answers
42k views

ImportError: No module named pip when trying to install packages

Have a fresh install of Ubuntu 13.10 with PyCharm and when setting up the python interpreter I selected 'install setuptools', then 'install pip'. Now if I try and do anything with pip I get the ...
Ciaran's user avatar
  • 555
11 votes
2 answers
9k views

Do I need to commit the dist folder to git in order to be able to install the package using pip from git?

I want to reuse some code for my internal team at work. My plan is to create a package and then have people install the package using pip straight out of our git repo. i.e. as shown here: https://pip....
Dan's user avatar
  • 45.5k
11 votes
3 answers
5k views

Ubuntu graphviz 'sfdp' not working

I'm trying to make some Networkx Graphviz graphs. After running: pos = nx.graphviz_layout(G, prog = 'sfdp'). An error occured, saying: Error: remove_overlap: Graphviz not built with triangulation ...
VlS's user avatar
  • 586
11 votes
2 answers
20k views

Python3 correct way to import relative or absolute?

I am writing a python module neuralnet. It was working all fine in Python2, but in Python3 imports are failing. This is my code structure. neuralnet/ __init__.py train.py # A wrapper ...
rakesh a's user avatar
  • 567
10 votes
1 answer
10k views

How are protobuf packages used?

I don't understand the first part of the last sentence on packages from google's Python protobuf docs: The .proto file starts with a package declaration, which helps to prevent naming conflicts ...
jsstuball's user avatar
  • 4,651
9 votes
3 answers
20k views

Python custom module name not defined

I have a custom package called 'package' and a custom module in that package called 'module' which has a function returning 'test' when called. When I import my package if I do: from package import ...
BSmith156's user avatar
9 votes
1 answer
9k views

How to create packages in Python 3? ModuleNotFoundError

I am following the easy guide on the Python Central to create a package for my code: https://www.pythoncentral.io/how-to-create-a-python-package/ So my directory structure is: main.py pack1/ ...
Kanerva Peter's user avatar
9 votes
1 answer
6k views

Is there any way to import python modules for an entire package?

I have a package structure that looks like this ├── Plugins │   ├── Eight_Ball.py │   ├── Ping.py │   ├── Weather.py │   ├── __init__.py Every .py file inside the package needs to import a few ...
TWOF's user avatar
  • 388
9 votes
1 answer
5k views

How to put data in a Python package using setup.cfg

I'm trying to create a package with with a data file, but it's not working. My setup.cfg (per link) is below. [metadata] name = my_package version = 1.0.0 description = My package description author = ...
John Henckel's user avatar
8 votes
1 answer
7k views

How do I use absolute and relative imports in python 3.6?

I have a python project/library called "slingshot" with the following directory structure: slingshot/ __init__.py __main__.py build.py deploy.py util/ __init__.py ...
tadasajon's user avatar
  • 14.7k
8 votes
1 answer
11k views

Python3 pkgutil get_data usage

I am trying to use pkgutil.get_data to get resource from a package. I have read through the documentation for this API , where it said To use pkgutil.get_data(package, resource) .... The package ...
helloworld's user avatar
8 votes
3 answers
1k views

Import structure that works both in packages and out, in both Python 2 and 3?

When I developed a package purely for Python 2, I could use the plain import b syntax to import a relative path without caring about whether the importing file was in a package or not. This had the ...
otus's user avatar
  • 5,672
7 votes
4 answers
49k views

error: Microsoft Visual C++ 14.0 is required when installing python package

I’m trying to download the package statsmodels by running in command prompt(admin) this command: pip3 install statsmodels and I get this error “error: Microsoft Visual C++ 14.0 is required. Get ...
AbdeAMNR's user avatar
  • 145
7 votes
3 answers
2k views

How to develop/include a Django custom reusable app in a new project? Are there some guidelines?

Following tutorial on Django reusable apps things work fine. But I have some questions about the process of developing and packaging a Django app. 1 - In the tutorial, the app is developed first ...
gustavovelascoh's user avatar
7 votes
3 answers
8k views

Including non-python files in a python package

I created and published a Python package, but I just can't get it to include a text file. Here is the repository: https://github.com/void4/gimpscm The file I need to include is procdump.txt, located ...
2080's user avatar
  • 1,312
7 votes
4 answers
18k views

Why does pip install not work for catboost?

I have to install catboost but can not make it by pip install catboost. There is not catboost library in Anaconda, so pip in the one way. The error message is: Could not find a version that ...
Lumos's user avatar
  • 610
7 votes
2 answers
5k views

How to create and load internal data in Python package

I'm developing a Python package, and the implementation of the Python package depends on some research result. I saved my research result in a Python dictionary. I have 2 questions: How to save ...
user9721758's user avatar
7 votes
1 answer
6k views

Python Package "No module named..."

I'm fairly new to Python, and I'm working on creating my first simple package. Here's my structure: Math/ __init__.py divide.py minus.py multiply.py plus.py Each of the four ...
whiterabbit25's user avatar
7 votes
1 answer
2k views

Imports inside package now that __init__.py is optional

I'm building a package that contains scripts to be run. They import modules contained in a subfolder directly under the script. Now that __init__ is not required after Python 3.3, what's the correct ...
Felix's user avatar
  • 2,638
7 votes
1 answer
17k views

Solving environment: | Found conflicts! Looking for incompatible packages. The updating is eternal

I have Ubuntu 18.04. I installed conda with python 2.7 some years ago. Finally I decided to pass to python 3.8 I create a new conda environment with python 3.8 and everything looked ok. When I tried ...
DennyZanchi's user avatar
7 votes
2 answers
4k views

Python: name of parent package not recognized in import statements

I understand that there are many questions on this topic, but most of the answers I've seen describe complex workarounds to problems that should, it seems to me, be simple. Here is my directory ...
Victor Odouard's user avatar
7 votes
5 answers
28k views

ImportError: cannot import name 'IntEnum'

I am trying to install upstox, which is a Python API for connecting to market data. I am unable to install it on Python3.5. My config is Python 3.5.3 (v3.5.3:1880cb95a742, Jan 16 2017, 15:51:26) [...
DrBug's user avatar
  • 2,014
6 votes
1 answer
11k views

Python install sub-package from package

it is possible to install some special sub-package from package? For example, I want to create package with slack, datadog, sentry plugins (wrappers). But I want to allow user what he wants to ...
Vladimir Chernenko's user avatar
6 votes
3 answers
2k views

How to properly package set of callable python scripts or modules

I've been searching the net for quite some time now but I can't seem to wrap my head around on how can I distribute my python scripts for my end user. I've been using my scripts on my command line ...
BLitE.exe's user avatar
  • 321
6 votes
1 answer
4k views

Circular imports in python3

I have a package which contain several files. Each file contains a class and the classes are interdependant. How can I avoid circular dependencies without putting all the code in one file. Is there a ...
freeza's user avatar
  • 378
6 votes
1 answer
35k views

File 'requirements.txt' in a Python package

I'm studying packages, and I have a question on creating a requirements.txt file. If a module is imported from Python, does it need to be mentioned in the requirements.txt file or can be left out? I ...
Asteroid098's user avatar
  • 2,795
5 votes
3 answers
7k views

syntax highlight (.tmLanguage) in Sublime Text 3 for packages

I work on this plugin Syntax highlight does not work with Sublime Text 3 when plugin is installed using package control. Error loading syntax file "Sublime Text 3/Installed Packages/robot.tmLanguage"...
user3067543's user avatar
5 votes
3 answers
11k views

Python imports - ModuleNotFoundError: No module named X

I have read probably all of the posts on here regarding imports and I still cannot figure out what is going on with the imports, I have spent hours trying to get a very simple example working and am ...
berimbolo's user avatar
  • 3,619

1
2 3 4 5
11