Re: [Imdbpy-help] Presentation and windows problem
On Sun, Nov 19, 2017 at 4:36 PM, Martín Torre Castro wrote: > > Installing from the gitHub clone did work perfectly. Great! I've also just release version 6.2, since the previous one contained some critical bugs. -- Davide Alberani [PGP KeyID: 0x3845A3D4AC9B61AD] http://www.mimante.net/ -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Imdbpy-help mailing list Imdbpy-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/imdbpy-help
Re: [Imdbpy-help] Presentation and windows problem
Installing from the gitHub clone did work perfectly. Thanks everyone El 18 nov. 2017 7:42 p. m., "Martín Torre Castro" < martin.torre.cas...@gmail.com> escribió: > The output is 6.0, all installed with pip. > > I'm uninstalling and downloading the latest version later following > instructions on the web. > > I'm letting you know the result > > El 18 nov. 2017 9:57 a. m., "Davide Alberani" > escribió: > >> On Thu, Nov 16, 2017 at 7:55 PM, Martín Torre Castro >> wrote: >> > >> >> The above one should already be fixed in the repository >> >> version: >> >> https://github.com/alberanid/imdbpy >> >> >> > IMDbPY==6.0 >> > >> > I'm checking now. It says everything is 'already-up-to-date'. >> >> Hi Martin, >> this does not seem to be the latest version. >> >> Executing this command: >> python3 -c 'import imdb ; print(imdb.__version__)' >> >> the output should be something like 6.1dev2017118 >> >> I've also fixed to bug parsing the imdbpy.cfg file. >> >> > Finally, I was trying the file from a very little gui in a '.pyw' file. >> Now >> > I tried only the text-mode script and it gives this error at the command >> > line. It's happening at the IMDb() call. >> >> As Turgut said, that was due to the fact that cookies were moved to a >> separated JSON file. >> I've reverted it, splitting the long lines, to prevent other similar >> cases. >> >> Let us know if it fixes. :-) >> >> >> -- >> Davide Alberani [PGP KeyID: >> 0x3845A3D4AC9B61AD] >> http://www.mimante.net/ >> > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Imdbpy-help mailing list Imdbpy-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/imdbpy-help
Re: [Imdbpy-help] Presentation and windows problem
Hi Martin, Please clone the GitHub repository and install that version. I do not make a new release every time I introduce some fixes. Il 18 nov 2017 19:42, "Martín Torre Castro" ha scritto: > The output is 6.0, all installed with pip. > > I'm uninstalling and downloading the latest version later following > instructions on the web. > > I'm letting you know the result > > El 18 nov. 2017 9:57 a. m., "Davide Alberani" > escribió: > >> On Thu, Nov 16, 2017 at 7:55 PM, Martín Torre Castro >> wrote: >> > >> >> The above one should already be fixed in the repository >> >> version: >> >> https://github.com/alberanid/imdbpy >> >> >> > IMDbPY==6.0 >> > >> > I'm checking now. It says everything is 'already-up-to-date'. >> >> Hi Martin, >> this does not seem to be the latest version. >> >> Executing this command: >> python3 -c 'import imdb ; print(imdb.__version__)' >> >> the output should be something like 6.1dev2017118 >> >> I've also fixed to bug parsing the imdbpy.cfg file. >> >> > Finally, I was trying the file from a very little gui in a '.pyw' file. >> Now >> > I tried only the text-mode script and it gives this error at the command >> > line. It's happening at the IMDb() call. >> >> As Turgut said, that was due to the fact that cookies were moved to a >> separated JSON file. >> I've reverted it, splitting the long lines, to prevent other similar >> cases. >> >> Let us know if it fixes. :-) >> >> >> -- >> Davide Alberani [PGP KeyID: >> 0x3845A3D4AC9B61AD] >> http://www.mimante.net/ >> > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Imdbpy-help mailing list Imdbpy-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/imdbpy-help
Re: [Imdbpy-help] Presentation and windows problem
The output is 6.0, all installed with pip. I'm uninstalling and downloading the latest version later following instructions on the web. I'm letting you know the result El 18 nov. 2017 9:57 a. m., "Davide Alberani" escribió: > On Thu, Nov 16, 2017 at 7:55 PM, Martín Torre Castro > wrote: > > > >> The above one should already be fixed in the repository > >> version: > >> https://github.com/alberanid/imdbpy > >> > > IMDbPY==6.0 > > > > I'm checking now. It says everything is 'already-up-to-date'. > > Hi Martin, > this does not seem to be the latest version. > > Executing this command: > python3 -c 'import imdb ; print(imdb.__version__)' > > the output should be something like 6.1dev2017118 > > I've also fixed to bug parsing the imdbpy.cfg file. > > > Finally, I was trying the file from a very little gui in a '.pyw' file. > Now > > I tried only the text-mode script and it gives this error at the command > > line. It's happening at the IMDb() call. > > As Turgut said, that was due to the fact that cookies were moved to a > separated JSON file. > I've reverted it, splitting the long lines, to prevent other similar cases. > > Let us know if it fixes. :-) > > > -- > Davide Alberani [PGP KeyID: > 0x3845A3D4AC9B61AD] > http://www.mimante.net/ > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Imdbpy-help mailing list Imdbpy-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/imdbpy-help
Re: [Imdbpy-help] Presentation and windows problem
On Thu, Nov 16, 2017 at 7:55 PM, Martín Torre Castro wrote: > >> The above one should already be fixed in the repository >> version: >> https://github.com/alberanid/imdbpy >> > IMDbPY==6.0 > > I'm checking now. It says everything is 'already-up-to-date'. Hi Martin, this does not seem to be the latest version. Executing this command: python3 -c 'import imdb ; print(imdb.__version__)' the output should be something like 6.1dev2017118 I've also fixed to bug parsing the imdbpy.cfg file. > Finally, I was trying the file from a very little gui in a '.pyw' file. Now > I tried only the text-mode script and it gives this error at the command > line. It's happening at the IMDb() call. As Turgut said, that was due to the fact that cookies were moved to a separated JSON file. I've reverted it, splitting the long lines, to prevent other similar cases. Let us know if it fixes. :-) -- Davide Alberani [PGP KeyID: 0x3845A3D4AC9B61AD] http://www.mimante.net/ -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Imdbpy-help mailing list Imdbpy-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/imdbpy-help
Re: [Imdbpy-help] Presentation and windows problem
Hi, Is it possible that pyinstaller doesn't handle the setup.py file and/or the MANIFEST.in file like the sdist command does? Those are the places where the cookies.json file is listed. Turgut On November 18, 2017 10:13:07 AM "H. Turgut Uyar" wrote: Hi, Is it possible that pyinstaller doesn't handle the setup.py file and/or the MANIFEST.in file like the sdist command does? Those are the places where the cookies.json file is listed. Turgut On November 16, 2017 9:55:34 PM Martín Torre Castro wrote: I'll try to build it on Windows, in the next days. Can you tell me how you have set up the environment? Which version of Python? Which command you run to build the .exe? Python 3.6.3 pyInstaller --onefile sample_get_info.py > 2017-11-16 00:44:46,732 WARNING [imdbpy] C:\Program Files > (x86)\Python36-32\lib\site-packages\imdb\__init__.py:165: Unable to read > configuration file; complete error: 'ConfigParserWithCase' object has no > attribute '_boolean_states' Nice; this seems to be a problem related to the parsing of the imdbpy.cfg file: remove it (I'll try to reproduce and fix the bug later), since you don't really need it. > grParser = GatherRefs(useModule=self._useModule) > AttributeError: 'DOMHTMLPlotParser' object has no attribute '_useModule' It seems you're using an old version. IMDbPY just came out of a huge set of changes, and it still have some bugs here and there. The above one should already be fixed in the repository version: https://github.com/alberanid/imdbpy IMDbPY==6.0 I'm checking now. It says everything is 'already-up-to-date'. Finally, I was trying the file from a very little gui in a '.pyw' file. Now I tried only the text-mode script and it gives this error at the command line. It's happening at the IMDb() call. Traceback (most recent call last): File "sample_get_info.py", line 56, in File "sample_get_info.py", line 24, in get_data File "site-packages\imdb\__init__.py", line 186, in IMDb File "", line 971, in _find_and_load File "", line 955, in _find_and_load_unlocked File "", line 665, in _load_unlocked File "c:\program files (x86)\python36-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module exec(bytecode, module.__dict__) File "site-packages\imdb\parser\http\__init__.py", line 99, in FileNotFoundError: [Errno 2] No such file or directory: 'C:\\UsersAppData\\Local\\Temp\\_MEI56602\\imdb\\parser\\http\\cookie s.json' -- -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot -- ___ Imdbpy-help mailing list Imdbpy-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/imdbpy-help -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Imdbpy-help mailing list Imdbpy-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/imdbpy-help
Re: [Imdbpy-help] Presentation and windows problem
> > I'll try to build it on Windows, in the next days. > Can you tell me how you have set up the environment? > Which version of Python? > Which command you run to build the .exe? > Python 3.6.3 pyInstaller --onefile sample_get_info.py > > > > 2017-11-16 00:44:46,732 WARNING [imdbpy] C:\Program Files > > (x86)\Python36-32\lib\site-packages\imdb\__init__.py:165: Unable to read > > configuration file; complete error: 'ConfigParserWithCase' object has no > > attribute '_boolean_states' > > Nice; this seems to be a problem related to the parsing of the > imdbpy.cfg file: remove it (I'll try to reproduce and fix the bug later), > since you don't really need it. > > > > grParser = GatherRefs(useModule=self._useModule) > > AttributeError: 'DOMHTMLPlotParser' object has no attribute '_useModule' > > It seems you're using an old version. > IMDbPY just came out of a huge set of changes, and it still have some bugs > here > and there. The above one should already be fixed in the repository > version: > https://github.com/alberanid/imdbpy > > IMDbPY==6.0 I'm checking now. It says everything is 'already-up-to-date'. Finally, I was trying the file from a very little gui in a '.pyw' file. Now I tried only the text-mode script and it gives this error at the command line. It's happening at the IMDb() call. Traceback (most recent call last): File "sample_get_info.py", line 56, in File "sample_get_info.py", line 24, in get_data File "site-packages\imdb\__init__.py", line 186, in IMDb File "", line 971, in _find_and_load File "", line 955, in _find_and_load_unlocked File "", line 665, in _load_unlocked File "c:\program files (x86)\python36-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module exec(bytecode, module.__dict__) File "site-packages\imdb\parser\http\__init__.py", line 99, in FileNotFoundError: [Errno 2] No such file or directory: 'C:\\UsersAppData\\Local\\Temp\\_MEI56602\\imdb\\parser\\http\\cookie s.json' -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Imdbpy-help mailing list Imdbpy-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/imdbpy-help
Re: [Imdbpy-help] Presentation and windows problem
On Thu, Nov 16, 2017 at 1:07 AM, Madtyn wrote: > > I started using imdbPY and I was very happy with the low difficulty in > larning how to use this tool. Hi Martin, I'm glad IMDbPY is useful to you! > The problem came when I did want to make a Windows '.exe' file for > distributing it. I'll try to build it on Windows, in the next days. Can you tell me how you have set up the environment? Which version of Python? Which command you run to build the .exe? > 2017-11-16 00:44:46,732 WARNING [imdbpy] C:\Program Files > (x86)\Python36-32\lib\site-packages\imdb\__init__.py:165: Unable to read > configuration file; complete error: 'ConfigParserWithCase' object has no > attribute '_boolean_states' Nice; this seems to be a problem related to the parsing of the imdbpy.cfg file: remove it (I'll try to reproduce and fix the bug later), since you don't really need it. > grParser = GatherRefs(useModule=self._useModule) > AttributeError: 'DOMHTMLPlotParser' object has no attribute '_useModule' It seems you're using an old version. IMDbPY just came out of a huge set of changes, and it still have some bugs here and there. The above one should already be fixed in the repository version: https://github.com/alberanid/imdbpy Hope this helps, -- Davide Alberani [PGP KeyID: 0x3845A3D4AC9B61AD] http://www.mimante.net/ -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Imdbpy-help mailing list Imdbpy-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/imdbpy-help
[Imdbpy-help] Presentation and windows problem
Hello everyone, I'm new. I'm Martin from Spain and in spite of working as Java programmer, I love Python and try to develop with it and learn as much as I can. I started using imdbPY and I was very happy with the low difficulty in larning how to use this tool. I made quickly a script which retrieves info from IMDb movies based on the input ID of the movie itself. I was developing under Ubuntu and it was always working, but giving an error, so I kept on. The problem came when I did want to make a Windows '.exe' file for distributing it. It seems that under Ubuntu you can execute with python properly despite the error, but in Windows the .exe file does not continue. The error is down here, and after it, I'm pasting my code, which is a single '.py' file. I tried creating a 'imdbpy.cfg' at the same directory, but it goes the same. The error happens just at the IMDb() call, as commented in my source code. When execued with Python under Windows the code works, but when I make the '.exe' with pyInstaller I checked that the execution stops at that line. I need some clue, even for researching myself and know how to make a '.exe' that works properly. Thanks in advance. ERROR: 2017-11-16 00:44:46,732 WARNING [imdbpy] C:\Program Files (x86)\Python36-32\lib\site-packages\imdb\__init__.py:165: Unable to read configuration file; complete error: 'ConfigParserWithCase' object has no attribute '_boolean_states' --- Logging error --- Traceback (most recent call last): File "C:\Program Files (x86)\Python36-32\lib\site-packages\imdb\parser\http\utils.py", line 499, in parse self.gather_refs(dom) File "C:\Program Files (x86)\Python36-32\lib\site-packages\imdb\parser\http\utils.py", line 594, in gather_refs grParser = GatherRefs(useModule=self._useModule) AttributeError: 'DOMHTMLPlotParser' object has no attribute '_useModule' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Program Files (x86)\Python36-32\lib\logging\__init__.py", line 992, in emit msg = self.format(record) File "C:\Program Files (x86)\Python36-32\lib\logging\__init__.py", line 838, in format return fmt.format(record) File "C:\Program Files (x86)\Python36-32\lib\logging\__init__.py", line 575, in format record.message = record.getMessage() File "C:\Program Files (x86)\Python36-32\lib\logging\__init__.py", line 338, in getMessage msg = msg % self.args TypeError: not enough arguments for format string Call stack: File "C:/Users/madtyn/PycharmProjects/telegram/api_samples/IMDb/gui.pyw", line 26, in root.mainloop() File "C:\Program Files (x86)\Python36-32\lib\tkinter\__init__.py", line 1277, in mainloop self.tk.mainloop(n) File "C:\Program Files (x86)\Python36-32\lib\tkinter\__init__.py", line 1699, in __call__ return self.func(*args) File "C:/Users/madtyn/PycharmProjects/telegram/api_samples/IMDb/gui.pyw", line 17, in getIMDbData text = get_data(e.get()) File "C:\Users\madtyn\PycharmProjects\telegram\api_samples\IMDb\sample_get_info.py", line 33, in get_data movie = ia.get_movie(token) File "C:\Program Files (x86)\Python36-32\lib\site-packages\imdb\__init__.py", line 392, in get_movie self.update(movie, info) File "C:\Program Files (x86)\Python36-32\lib\site-packages\imdb\__init__.py", line 702, in update ret = method(mopID) File "C:\Program Files (x86)\Python36-32\lib\site-packages\imdb\parser\http\__init__.py", line 523, in get_movie_plot return self.mProxy.plot_parser.parse(cont, getRefs=self._getRefs) File "C:\Program Files (x86)\Python36-32\lib\site-packages\imdb\parser\http\utils.py", line 502, in parse self._cname, exc_info=True) Message: '%s: unable to gather refs: %s' Arguments: ('DOMHTMLPlotParser',) MY CODE: from imdb import IMDb import requests from bs4 import BeautifulSoup def get_field_attr(movie, field, attr, keyErrorValue='Not available'): try: info = movie[field] if isinstance(movie[field], list): result = ', '.join([elem[attr] for elem in info]) else: result = movie[field][attr] except KeyError: result = keyErrorValue return result def get_data(token): ia = IMDb() # Here the error shows up and then keeps! try: movie = ia.get_movie(token) except (TypeError, AttributeError): pass if movie: template = """Year: {year} | Director: {director} | Producer: {producer} | Writer: {writer} | Music: {music} | Cinematography: {cinematography} | Editing: {editor} | Cast: {cast} | Genres: {genres} | Duration: {duration}""" fields = ['director', 'producer', 'writer', 'cinematography', 'editor'] my_dict = {field: get_field_attr(movie, field, 'name') for field in fields} my_dict['music'] = get_field_attr(movie, 'music', 'name', keyErrorValue='No original music found') try: url = 'http://www.imdb.com/title/tt{}/?ref_=nv_sr_1'.format