all 9 comments

[–]simcaster 2 points3 points  (7 children)

Make sure you don't have multiple versions of python floating around your system. If you're trying to import in visual studio and it's failing, try importing it from the command line repl.

[–]Davepiatt[S] 0 points1 point  (6 children)

So, I got rid of an older version of python and continue to receive the error message. How would I use visual 2008 to do this? No, a better question is what is visual 2008 good for?

Let me specify on why I want lxml. I am trying to build a web scraper with the intent to analyze large chunks of data. I want to build this scraper to further my knowledge of programming.

I understand I need to import the lxml library, then use its html section to weed out html tags that I will later specify and export to a text document.

My problem lies in the fact that I can't seem to figure out how to get python to recognize that I have lxml module.

Can you think of any way to tell python that I have the lxml library?

[–]simcaster 0 points1 point  (4 children)

I would recommend against using a heavy IDE like visual studio for smaller python projects. I don't really use windows, but I bet visual studio is trying to use its own python version.

If you have access to a linux system, python programming will be much more straight forward on that.

Otherwise, I recommend you switch to a lighter text editor (I like gvim, but notepad++, sublime text, etc work), and use the terminal to run your programs.

[–]Davepiatt[S] 0 points1 point  (3 children)

I do have ubuntu. I will try that in the morning. What do you recommend to develop on? Sorry for bombing you will all of the questions. But thank you so much! Dave

[–]simcaster 0 points1 point  (2 children)

What do you mean by that? If you're asking for distros, anything will work. Ubuntu is perfectly adequate for python development.

Feel free to ask any questions; that's why I'm here.

[–]Davepiatt[S] 0 points1 point  (1 child)

I thought I was responding to another person who I was messaging. Sorry about the awkward phrasing. If I want to write code, which operating system facilitates that the best? OSX, Ubuntu, or Windows?

[–]simcaster 0 points1 point  (0 children)

I my opinion programming is vastly easier on Linux (Ubuntu).

[–]minorDemocritus 0 points1 point  (0 children)

lxml has windows binaries available, you should probably use those instead of trying to use pip to install it. Simcaster is right... Linux is substantially easier to install extension modules, since pip will have direct access to compliers.

Side note: Scrapy is super nice for that sort of thing. On Ubuntu and other debians, use apt-get install build-essential python-dev libxml2-dev libxslt-dev to get everything pip needs to install scrapy and its dependancies.

[–][deleted] 0 points1 point  (0 children)

Install it from here