ImportError: cannot import name 'Main' => Cannot install module with pip - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: ImportError: cannot import name 'Main' => Cannot install module with pip (/thread-7404.html) |
ImportError: cannot import name 'Main' => Cannot install module with pip - Oby4455 - Jan-09-2018 Hello, I am trying to compile a python script and I have to install a module called "main". when I try to install it with pip I am getting the following erorr : Quote:ImportError: cannot import name 'Main' How can I fix this ? Thank you in advance for your help RE: ImportError: cannot import name 'Main' => Cannot install module with pip - Gribouillis - Jan-09-2018 If you write pip install main , it means that you are trying to install this module from pypi, which calculates the price of a book from its title. Is it really what you want to do?If python writes ImportError: cannot import name 'Main' , it means that it cannot import a class or function or some other python object named Main. The solution is not to use pip . If you post the whole error traceback here, it will probably help us diagnose the error.
RE: ImportError: cannot import name 'Main' => Cannot install module with pip - Oby4455 - Jan-09-2018 Thank you. I am new to Python and didn't know that. I assumed it was a module. This is what I am getting in the powershell (I am on Windows 10) : Quote:PS C:\Users\admin> cd C:\pdfconvert_source RE: ImportError: cannot import name 'Main' => Cannot install module with pip - snippsat - Jan-09-2018 Do you have a link to what you are trying to install? RE: ImportError: cannot import name 'Main' => Cannot install module with pip - Oby4455 - Jan-09-2018 No it's a program that was made by a friend of mine... does the error I am getting means there is something wrong with the script? RE: ImportError: cannot import name 'Main' => Cannot install module with pip - Gribouillis - Jan-09-2018 The error means that python detects a cyclic import: the starter.py file needs to import an object named Main from the file pdfconvert_qt.py, and this file in turn needs to import the starter module. This is a design flaw in the program. There may be solutions, but without the code it is difficult to help. |