Skip to content
This repository has been archived by the owner on Dec 17, 2021. It is now read-only.

ImportError: No module named apache_beam #51

Closed
yash26061981 opened this issue Jun 5, 2017 · 9 comments
Closed

ImportError: No module named apache_beam #51

yash26061981 opened this issue Jun 5, 2017 · 9 comments

Comments

@yash26061981
Copy link

Hi,

While running the flower sample, i am getting error:

python trainer/preprocess.py
--input_dict "$DICT_FILE"
--input_path "gs://cloud-ml-data/img/flower_photos/eval_set.csv"
--output_path "${GCS_PATH}/preproc/eval"
--cloud
Traceback (most recent call last):
File "trainer/preprocess.py", line 71, in
import apache_beam as beam
ImportError: No module named apache_beam

I have followed the requirement guidelines. I dont know why i am getting this error. Any help please?

@mnanal
Copy link

mnanal commented Jun 5, 2017

I also see the same error while running flower sample.

@yash26061981
Copy link
Author

@elibixby any idea to solve this issue.

@mnanal
Copy link

mnanal commented Jun 6, 2017

Hey Yash,
I was able to solve using following steps,

  1. Read following nice article on virtualenv, this will help in later steps,
    https://www.dabapps.com/blog/introduction-to-pip-and-virtualenv-python/?utm_source=feedly

  2. Create virtual environment ( Note I created it in cloudml-samples folder & named it env)
    titanium-vim-169612:~/cloudml-samples$ virtualenv env

  3. Activate virtual env
    @titanium-vim-169612:~/cloudml-samples$ source env/bin/activate

  4. Install cloud-dataflow using following link: (this brings in apache_beam)
    https://cloud.google.com/dataflow/docs/quickstarts/quickstart-python

Now u can check that apache_beam is present in env/lib/python2.7/site-packages/
@titanium-vim-169612:~/cloudml-samples/flowers$ ls ../env/lib/python2.7/site-packages/

  1. Run the sample

At this point, I got an error about missing tensorflow. I installed tensorflow in my virtualenv by using the link below (use installation steps for virtualenv),
https://www.tensorflow.org/install/install_linux#InstallingVirtualenv

The sample seems to work now..

@yash26061981
Copy link
Author

Thanks @mnanal . Yes this solves the issue. Just a bit more help. What if i want to use VGG16 instead of inception?

@mnanal
Copy link

mnanal commented Jun 9, 2017

sorry, I have no idea on how to use VGG16 instead of inception. I assume it will involve changing the python code after doing above setup..

@puneith
Copy link
Contributor

puneith commented Jun 29, 2017

@yash26061981 Please take a look at Keras version https://www.tensorflow.org/api_docs/python/tf/contrib/keras/applications/VGG16 and I see coreTF versions as well if you search them.

@smikwazir
Copy link

Hey @mnanal - this solution worked for me too thanks

@ghost
Copy link

ghost commented Mar 2, 2018

Hi Everyone,
I did solve this problem by doing pip install apache-beam on command prompt in C:\Users\AwesomeUser\AppData\Local\Continuum\Anaconda2\Lib\site-packages and then restarted intellij and viola it worked.
PS: I use windows system, love the challenge

@gunar
Copy link

gunar commented Aug 31, 2021

For my problem, the solution was using the command python3 instead of python:

$ python3 -m apache_beam.examples.wordcount …

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants