pyatv icon indicating copy to clipboard operation
pyatv copied to clipboard

setup_dev_env.sh fails

Open rosahas opened this issue 9 years ago • 11 comments

I ran this command to get the new "play_media" option. Although, even when it works, not sure how I would use this vir_env to run it with Home-Assistant.io yet?

In any case, I ran the setup command with both user "pi" as well as with "sudo" up front.. same error:

-> Using python: python3.4 -> Creating python virtual environment... Running virtualenv with interpreter /usr/bin/python3.4 Using base prefix '/usr' New python executable in /home/pi/programming/ha_custom_comp_media_player_atv/pyatv/bin/python3.4 Not overwriting existing python script /home/pi/programming/ha_custom_comp_media_player_atv/pyatv/bin/python (you must use /home/pi/programming/ha_custom_comp_media_player_atv/pyatv/bin/python3.4) Installing setuptools, pip, wheel...done. -> Activating virtual environment... -> Upgrading pip... Requirement already up-to-date: pip in ./lib/python3.4/site-packages -> Installing library as develop... running develop running egg_info writing top-level names to pyatv.egg-info/top_level.txt writing pyatv.egg-info/PKG-INFO writing entry points to pyatv.egg-info/entry_points.txt writing dependency_links to pyatv.egg-info/dependency_links.txt reading manifest file 'pyatv.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*~' found anywhere in distribution warning: manifest_maker: MANIFEST.in, line 11: unknown action 'prunt'

writing manifest file 'pyatv.egg-info/SOURCES.txt' running build_ext Creating /home/pi/programming/ha_custom_comp_media_player_atv/pyatv/lib/python3.4/site-packages/pyatv.egg-link (link to .) pyatv 0.0.2.dev1 is already the active version in easy-install.pth Installing atvremote script to /home/pi/programming/ha_custom_comp_media_player_atv/pyatv/bin

Installed /home/pi/programming/ha_custom_comp_media_player_atv/pyatv Processing dependencies for pyatv==0.0.2.dev1 Finished processing dependencies for pyatv==0.0.2.dev1 -> Installing test dependencies... Requirement already satisfied: asynctest==0.9.0 in ./lib/python3.4/site-packages (from -r requirements_test.txt (line 1)) Requirement already satisfied: flake8>=3.0.4 in ./lib/python3.4/site-packages (from -r requirements_test.txt (line 2)) Requirement already satisfied: pylint>=1.5.6 in ./lib/python3.4/site-packages (from -r requirements_test.txt (line 3)) Requirement already satisfied: coveralls>=1.1 in ./lib/python3.4/site-packages (from -r requirements_test.txt (line 4)) Requirement already satisfied: pytest>=2.9.2 in ./lib/python3.4/site-packages (from -r requirements_test.txt (line 5)) Requirement already satisfied: pytest-cov>=2.3.1 in ./lib/python3.4/site-packages (from -r requirements_test.txt (line 6)) Requirement already satisfied: pytest-timeout>=1.0.0 in ./lib/python3.4/site-packages (from -r requirements_test.txt (line 7)) Requirement already satisfied: pytest-aiohttp==0.1.3 in ./lib/python3.4/site-packages (from -r requirements_test.txt (line 8)) Requirement already satisfied: pydocstyle>=1.0.0 in ./lib/python3.4/site-packages (from -r requirements_test.txt (line 9)) Requirement already satisfied: mypy-lang>=0.4 in ./lib/python3.4/site-packages (from -r requirements_test.txt (line 10)) Requirement already satisfied: Sphinx==1.5.1 in ./lib/python3.4/site-packages (from -r requirements_test.txt (line 11)) Requirement already satisfied: pycodestyle<2.4.0,>=2.0.0 in ./lib/python3.4/site-packages (from flake8>=3.0.4->-r requirements_test.txt (line 2)) Requirement already satisfied: pyflakes<1.6.0,>=1.5.0 in ./lib/python3.4/site-packages (from flake8>=3.0.4->-r requirements_test.txt (line 2)) Requirement already satisfied: mccabe<0.7.0,>=0.6.0 in ./lib/python3.4/site-packages (from flake8>=3.0.4->-r requirements_test.txt (line 2)) Requirement already satisfied: six in ./lib/python3.4/site-packages (from pylint>=1.5.6->-r requirements_test.txt (line 3)) Requirement already satisfied: astroid<1.5.0,>=1.4.5 in ./lib/python3.4/site-packages (from pylint>=1.5.6->-r requirements_test.txt (line 3)) Requirement already satisfied: isort>=4.2.5 in ./lib/python3.4/site-packages (from pylint>=1.5.6->-r requirements_test.txt (line 3)) Requirement already satisfied: requests>=1.0.0 in ./lib/python3.4/site-packages (from coveralls>=1.1->-r requirements_test.txt (line 4)) Requirement already satisfied: docopt>=0.6.1 in ./lib/python3.4/site-packages (from coveralls>=1.1->-r requirements_test.txt (line 4)) Requirement already satisfied: coverage>=3.6 in ./lib/python3.4/site-packages (from coveralls>=1.1->-r requirements_test.txt (line 4)) Requirement already satisfied: setuptools in ./lib/python3.4/site-packages (from pytest>=2.9.2->-r requirements_test.txt (line 5)) Requirement already satisfied: py>=1.4.29 in ./lib/python3.4/site-packages (from pytest>=2.9.2->-r requirements_test.txt (line 5)) Requirement already satisfied: aiohttp>=0.22.0 in ./lib/python3.4/site-packages (from pytest-aiohttp==0.1.3->-r requirements_test.txt (line 8)) Requirement already satisfied: docutils>=0.11 in ./lib/python3.4/site-packages (from Sphinx==1.5.1->-r requirements_test.txt (line 11)) Requirement already satisfied: Jinja2>=2.3 in ./lib/python3.4/site-packages (from Sphinx==1.5.1->-r requirements_test.txt (line 11)) Requirement already satisfied: babel!=2.0,>=1.3 in ./lib/python3.4/site-packages (from Sphinx==1.5.1->-r requirements_test.txt (line 11)) Requirement already satisfied: imagesize in ./lib/python3.4/site-packages (from Sphinx==1.5.1->-r requirements_test.txt (line 11)) Requirement already satisfied: Pygments>=2.0 in ./lib/python3.4/site-packages (from Sphinx==1.5.1->-r requirements_test.txt (line 11)) Requirement already satisfied: alabaster<0.8,>=0.7 in ./lib/python3.4/site-packages (from Sphinx==1.5.1->-r requirements_test.txt (line 11)) Requirement already satisfied: snowballstemmer>=1.1 in ./lib/python3.4/site-packages (from Sphinx==1.5.1->-r requirements_test.txt (line 11)) Requirement already satisfied: lazy-object-proxy in ./lib/python3.4/site-packages (from astroid<1.5.0,>=1.4.5->pylint>=1.5.6->-r requirements_test.txt (line 3)) Requirement already satisfied: wrapt in ./lib/python3.4/site-packages (from astroid<1.5.0,>=1.4.5->pylint>=1.5.6->-r requirements_test.txt (line 3)) Requirement already satisfied: packaging>=16.8 in ./lib/python3.4/site-packages (from setuptools->pytest>=2.9.2->-r requirements_test.txt (line 5)) Requirement already satisfied: appdirs>=1.4.0 in ./lib/python3.4/site-packages (from setuptools->pytest>=2.9.2->-r requirements_test.txt (line 5)) Requirement already satisfied: multidict>=2.1.4 in ./lib/python3.4/site-packages (from aiohttp>=0.22.0->pytest-aiohttp==0.1.3->-r requirements_test.txt (line 8)) Requirement already satisfied: yarl>=0.8.1 in ./lib/python3.4/site-packages (from aiohttp>=0.22.0->pytest-aiohttp==0.1.3->-r requirements_test.txt (line 8)) Requirement already satisfied: async-timeout>=1.1.0 in ./lib/python3.4/site-packages (from aiohttp>=0.22.0->pytest-aiohttp==0.1.3->-r requirements_test.txt (line 8)) Requirement already satisfied: chardet in ./lib/python3.4/site-packages (from aiohttp>=0.22.0->pytest-aiohttp==0.1.3->-r requirements_test.txt (line 8)) Requirement already satisfied: MarkupSafe>=0.23 in ./lib/python3.4/site-packages (from Jinja2>=2.3->Sphinx==1.5.1->-r requirements_test.txt (line 11)) Requirement already satisfied: pytz>=0a in ./lib/python3.4/site-packages (from babel!=2.0,>=1.3->Sphinx==1.5.1->-r requirements_test.txt (line 11)) Requirement already satisfied: pyparsing in ./lib/python3.4/site-packages (from packaging>=16.8->setuptools->pytest>=2.9.2->-r requirements_test.txt (line 5)) Requirement already satisfied: tox in ./lib/python3.4/site-packages Requirement already satisfied: virtualenv>=1.11.2; python_version != "3.2" in ./lib/python3.4/site-packages (from tox) Requirement already satisfied: pluggy<1.0,>=0.3.0 in ./lib/python3.4/site-packages (from tox) Requirement already satisfied: py>=1.4.17 in ./lib/python3.4/site-packages (from tox) -> Running tests as verification... running test running egg_info writing top-level names to pyatv.egg-info/top_level.txt writing pyatv.egg-info/PKG-INFO writing dependency_links to pyatv.egg-info/dependency_links.txt writing entry points to pyatv.egg-info/entry_points.txt reading manifest file 'pyatv.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*~' found anywhere in distribution warning: manifest_maker: MANIFEST.in, line 11: unknown action 'prunt'

writing manifest file 'pyatv.egg-info/SOURCES.txt' running build_ext Traceback (most recent call last): File "setup.py", line 34, in 'Topic :: Home Automation', File "/usr/lib/python3.4/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands self.run_command(cmd) File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/home/pi/programming/ha_custom_comp_media_player_atv/pyatv/lib/python3.4/site-packages/setuptools/command/test.py", line 211, in run self.run_tests() File "/home/pi/programming/ha_custom_comp_media_player_atv/pyatv/lib/python3.4/site-packages/setuptools/command/test.py", line 234, in run_tests **exit_kwarg File "/usr/lib/python3.4/unittest/main.py", line 92, in init self.parseArgs(argv) File "/usr/lib/python3.4/unittest/main.py", line 139, in parseArgs self.createTests() File "/usr/lib/python3.4/unittest/main.py", line 146, in createTests self.module) File "/usr/lib/python3.4/unittest/loader.py", line 146, in loadTestsFromNames suites = [self.loadTestsFromName(name, module) for name in names] File "/usr/lib/python3.4/unittest/loader.py", line 146, in suites = [self.loadTestsFromName(name, module) for name in names] File "/usr/lib/python3.4/unittest/loader.py", line 117, in loadTestsFromName return self.loadTestsFromModule(obj) File "/home/pi/programming/ha_custom_comp_media_player_atv/pyatv/lib/python3.4/site-packages/setuptools/command/test.py", line 43, in loadTestsFromModule tests.append(self.loadTestsFromName(submodule)) File "/usr/lib/python3.4/unittest/loader.py", line 114, in loadTestsFromName parent, obj = obj, getattr(obj, part) AttributeError: 'module' object has no attribute 'test_interface'

rosahas avatar Feb 07 '17 18:02 rosahas

Gah, I hate these errors. They usually appear because of a module name conflict with another package. Which is really strange since this is in a virtual environment... Anyways, it's just the test so you can go on anyways. I will try to figure out a solution and come back to you if I find any. Please try to keep this environment around in case we need to test something.

postlund avatar Feb 07 '17 18:02 postlund

Ok, will do. The "atvremote" does not run in this env .. :

(pyatv) pi@raspberrypi:~/programming/ha_custom_comp_media_player_atv/pyatv $ atvremote Traceback (most recent call last): File "/home/pi/programming/ha_custom_comp_media_player_atv/pyatv/bin/atvremote", line 11, in load_entry_point('pyatv', 'console_scripts', 'atvremote')() File "/home/pi/programming/ha_custom_comp_media_player_atv/pyatv/lib/python3.4/site-packages/pkg_resources/init.py", line 560, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/home/pi/programming/ha_custom_comp_media_player_atv/pyatv/lib/python3.4/site-packages/pkg_resources/init.py", line 2642, in load_entry_point return ep.load() File "/home/pi/programming/ha_custom_comp_media_player_atv/pyatv/lib/python3.4/site-packages/pkg_resources/init.py", line 2296, in load return self.resolve() File "/home/pi/programming/ha_custom_comp_media_player_atv/pyatv/lib/python3.4/site-packages/pkg_resources/init.py", line 2302, in resolve module = import(self.module_name, fromlist=['name'], level=0) File "/home/pi/programming/ha_custom_comp_media_player_atv/pyatv/pyatv/init.py", line 8, in from zeroconf import ServiceBrowser, Zeroconf ImportError: No module named 'zeroconf' (pyatv) pi@raspberrypi:~/programming/ha_custom_comp_media_player_atv/pyatv $

rosahas avatar Feb 07 '17 19:02 rosahas

Oh... I have some commits that I though I pushed, but didn't... Will create a PR and merge them right away. Stay put.

postlund avatar Feb 07 '17 19:02 postlund

Try make a pull and run the script again.

postlund avatar Feb 07 '17 19:02 postlund

Forgot that this is on a different branch. I rebased it against master and pushed the update. So now you should be able to just pull and run the script. Sorry about that.

postlund avatar Feb 07 '17 19:02 postlund

No problem. Do you mean as pip install or via the same setup script?

rosahas avatar Feb 08 '17 01:02 rosahas

The same setup script. But I have pushed this support and released 0.1.1, so that version is OK to use too.

postlund avatar Feb 08 '17 05:02 postlund

The best would be if you could try this PR in Home Assistant: https://github.com/home-assistant/home-assistant/pull/5801

It should contain what is currently the latest and greatest.

postlund avatar Feb 08 '17 05:02 postlund

Everything needed is on dev in Home Assistant now, so if you just update hass it should hopefully work. Can you verify if does? Also, can you verify if the setup-script works so that we can close this issue?

postlund avatar Feb 09 '17 07:02 postlund

Yes it work.. the setup script works as well as downloading the latest pyatv works as well, we can close it.

rosahas avatar Feb 09 '17 07:02 rosahas

Great! 👍

postlund avatar Feb 09 '17 07:02 postlund