Search Results

Search found 14344 results on 574 pages for 'path'.

Page 3/574 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Setting Ubuntu Global PATH for Ruby Enterprise Edition

    - by Wally Glutton
    Context: I recently installed Ruby Enterprise Edition (REE) on an Ubuntu 8.04 server. I would like for this new version of Ruby to globally supersede (for all users, crontabs, etc) the older version in /usr/local/bin. Attempted Solution #1: The REE documentation recommends placing the REE bin folder at the beginning of the global PATH in /etc/environment. I altered the PATH line in this file to read: PATH="/opt/ruby_ee/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" This did affect my PATH at all. Attempted Solution #2: Next I followed these instructions and updated the PATH setting in the /etc/login.defs and /etc/crontab files. (I did not change /etc/sudoers.) This didn't affect my PATH either, even after logging out and rebooting the server. Other information: I seem to be having the same problem described here. I'm testing using the command: echo $PATH My shell is bash. My .bashrc doesn't not alter my PATH. I'm ssh'ed into the system for all testing. /opt/ruby_ee/ is a sym-link to /opt/ruby-enterprise-1.8.7-2011.03/

    Read the article

  • Command prompt cannot find PATH variable

    - by davidXYZ
    Sometimes, my command prompt cannot find the PATH variable. I have this occasional problem at work where when I open command-prompt and run commands like ipconfig or subst, I get an error saying something like 'ipconfig' is not recognized as an internal or external command. When I try this echo %path%, it prints out %path% instead of the PATH value. If I look at my Environment Variables window, the PATH is defined right there but I don't know why CMD can't find it. At this point, I understand why the other commands were not being recognized since their paths are in PATH variable. However, I cannot understand why the PATH variable is not being found. If I restart the computer, everything is back to normal. In a few days, I might have the same experience again. I tried using this answer. It suggested changing a registry value but mine already had the value that was suggested yet it wasn't working. (The restart step at the end would have solved it as usual but that's not the point.) Any suggestions regarding why the PATH variable may become invisible every now and then and how I can prevent it from happening again?

    Read the article

  • Trouble setting up PATH for Java on Debian

    - by milkmansrevenge
    I am trying to get Oracle Java 7 update 3 working correctly on Debian 6. I have downloaded and set up the files in /usr/java/jre1.7.0_03. I have also set the following two lines at the end of /etc/bash.bashrc: export JAVA_HOME=/usr/java/jre1.7.0_03 export PATH=$PATH:$JAVA_HOME/bin Logging in as other users and root is fine, Java can be found: chris@mc:~$ java -version java version "1.7.0_03" Java(TM) SE Runtime Environment (build 1.7.0_03-b04) Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode) However there are two cases where Java cannot be found as detailed below. Note that both of these worked fine when I have previously installed OpenJDK Java 6 via aptitude, but I need Oracle Java 7 for various reasons. Most importantly, I cannot run commands as another user via su, despite the PATH showing that Java should be present. The user was created with adduser chris root@mc:~# su chris -c "echo $PATH" /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/java/jre1.7.0_03/bin:/bin root@mc:~# su chris -c "java -version" bash: java: command not found root@mc:~# su chris -c "/usr/java/jre1.7.0_03/bin/java -version" java version "1.7.0_03" ... How can it be in the PATH but not be found? Update 05/04/2012: explained by Daniel, to do with it being a non-interactive shell so files such as /etc/profile and /etc/bash.bashrc are not executed. Doing a full swap to that user and running Java works: root@mc:~# su chris chris@mc:/root$ java -version java version "1.7.0_03" ... I run a script on start up which exhibits similar but slightly different problems. The script is located in /etc/init.d/start-mystuff.sh and calls a jar: #!/bin/bash # /etc/init.d/start-mystuff.sh java -jar /opt/Mars.jar I can confirm that the script runs on start up and the exit code is 127, which indicates command not found. Inserting a line to print/save the PATH shows that it is: /sbin:/usr/sbin:/bin:/usr/bin This second problem isn't as important because I can just point directly to the Java executable in the script, but I am still curious! I have tried setting the full PATH and JAVA_HOME explicitly in /etc/environment which didn't help. I have also tried setting them in /etc/profile which doesn't seem to help either. I have tried logging in and out again after setting PATH in the various locations (duh!). Anyway, long post for what will probably have a simple one line solution :( Any help with this would be greatly appreciated, I have spent far too long trying to fix it by myself. Motivation The first problem may seem obscure but in my system I have users that are not allowed SSH access yet I still want to run processes as them. I have a ton of scripts operating in this way and don't want to have to change them all.

    Read the article

  • $PATH is driving me nuts

    - by Chris4d
    OK, apologies if this is something dumb, but I'm running out of ideas. Goal: prepend /usr/local/bin to $PATH Problem: $PATH won't do what I want or expect How I got here: I want to start learning to program, so I'm getting comfortable messing around under the hood, but don't have a lot of experience. I installed the fish shell (because it's friendly!) using homebrew and set it as my default shell (under system prefs>users & groups>advanced). At some point, I ran brew doctor to see if my installs were all kosher, and it suggested I move /usr/local/bin to the front of $PATH so that I could use my installation of git rather than the system copy. Fine - but between path_helper and fish, something was happening to $PATH that was out of my control, and I could never get the paths arranged in the right way. Environment: OSX 10.8.2, upgraded from 10.7ish, with xcode and devtools installed, plus x11, homebrew, and fish More info: I've set my user's default shell back to bash, and tried a variety of shells thru terminal.app - bash, fish, sh. I moved /usr/local/bin to the top of /etc/paths but it didn't change anything. I looked thru the various config.fish files and commented out stuff that might mess with $PATH, didn't help. I have the following files in /etc/paths.d/: ./10-homebrew containing /usr/local/bin ./20-fish containing /usr/local/Cellar/fish/1.23.1/bin ./40-XQuartz containing /opt/X11/bin I added set +x to my profile and when I start terminal.app I get: Last login: Mon Oct 1 13:31:06 on ttys000 + '[' -x /usr/libexec/path_helper ']' + eval '/usr/libexec/path_helper -s' ++ /usr/libexec/path_helper -s PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/Cellar/fish/1.23.1/bin:/opt/X11/bin"; export PATH; + '[' /bin/bash '!=' no ']' + '[' -r /etc/bashrc ']' + . /etc/bashrc ++ '[' -z '\s-\v\$ ' ']' ++ PS1='\h:\W \u\$ ' ++ shopt -s checkwinsize ++ '[' Apple_Terminal == Apple_Terminal ']' ++ '[' -z '' ']' ++ PROMPT_COMMAND='update_terminal_cwd; ' ++ update_terminal_cwd ++ local 'SEARCH= ' ++ local REPLACE=%20 ++ local PWD_URL=file://Chriss-iMac.local/Users/c4 ++ printf '\e]7;%s\a' file://Chriss-iMac.local/Users/c4 Chriss-iMac:~ c4$ So it looks like path_helper runs, but then running echo $PATH nets me /usr/bin:/bin:/usr/sbin:/sbin. So, it looks like path_helper isn't even doing what it's supposed to anymore? I'm sure there is some well-defined behavior here that I don't understand, or I borked something while trying to fix it. Please help!

    Read the article

  • Is there a reasonable way to attach new path to PATH in bashrc?

    - by Ripley
    Guys I constantly need to attach new paths to the PATH environment variable in .bashrc, like below: export PATH=/usr/local/bin:$PATH Then to make it take effect, I always do 'source ~/.bashrc' or '. ~/.bashrc', while I found one shortcoming of doing so which make me uncomfortable. If I keep doing so, the PATH will getting longer and longer with many duplicated entries, for example in the previous command, if I source it twice, the value of PATH will be PATH=/usr/local/bin:/usr/local/bin:/usr/local/bin:$PATH(<-the original path). Is there a more decent way to attach new path to PATH in bashrc without making it ugly?

    Read the article

  • Photoshop CS4 path problem

    - by Fuxi
    hi, i'm having a strange problem with photoshop: i'm creating a new layer then use the path tool for drawing something. the new path will then only show up under "paths" but the current layer remains empty. shouldn't it show up there being labelled as "shape"? what i want is creating a path, apply layer styles to it and keep the possibilty to change that path with layer styles applied. seems like some setting was changed inside my cs4 thanks

    Read the article

  • Insufficient Permissions on UNC Path for Physical Path in IIS7

    - by Eric C
    I've got a multi-server setup where Server A is hosting the html files and Server B is running IIS 7.5. I've specified a UNC path for the Physical Path of the website on Server B. When I try to hit localhost I'm receiving the following error: Cannot read configuration file due to insufficient permissions I am able to browse and modify files in the UNC path on Server B. I'm guessing it has something to do with IIS_IUSRS of Server B not having permissions, but I'm unsure how to add them to the shared directory of Server A.

    Read the article

  • Long file path returning 404 for "hello.htm"

    - by Adam Kane
    Hello, I have a long file path that works on my server, but a simliar path returns a 404 error when it is on my clients (IIS6) server (http://ddmat.com/). Here's the functioning file path on my server: http://www.forgefx.com/projects/ddmat/install/Application Files/McCurdys_1_0_0_0/Content/FBX/CCAE1B33/Roof-sectionB-02.fbm/hello.htm My guesses: Maybe the file path is too long? Maybe the ".fbm" in the directory path is invalid? Sorry for the vauge problem description. Please let me know what additional info I can provide that'd be helpful. Update: The problem happens even in short paths, with no spaces: http://www.myserver/test.folder/hell.htm Thanks, Adam

    Read the article

  • How do you use environment variables, such as %CommonProgramFiles%, in the PATH and have them recogn

    - by Brad Knowles
    I'm trying to add C:\Program Files\Common Files\xxx\xxx to the system PATH environment variable by appending %CommonProgramFiles%\xxx\xxx to the existing path. After rebooting, I open a command prompt and check the PATH. It expands correctly. However, when using Process Explorer from Sysinternals to view the Environment variables on services.exe, it shows the unexpanded version. Coincidentally, the paths using %SystemRoot% expand and are recognized just fine. I've tried altering the PATH through the Environment Variables window from System Properties and through direct Registry manipulation, neither seems to work. Is it possible to use other environment variables, besides %SystemRoot% in PATH and have services.exe understand it?

    Read the article

  • define software path

    - by shantanuo
    I have an older version already installed. I have upraded the package using setup.py install command. But the path is not correctly set. When I type "s3cmd" is shows the older version of software. # s3cmd s3cmd [options] <command> [arg(s)] version 1.2.6 --help -h --verbose -v --dryrun -n # which s3cmd /usr/local/bin/s3cmd The correct version is in different folder and I will like that to be used whenever I type the command. # /usr/bin/s3cmd Consider using --configure parameter to create one. How do I set path? I have added path to .bash_profile file but it does not work. PATH=$PATH:/usr/bin/s3cmd

    Read the article

  • Where is OS X's $PATH set?

    - by thepurplepixel
    I have a little $PATH problem: I just reinstalled MacPorts, and my path contains the MacPorts directories as it should at the beginning of $PATH. However, despite me having no such setting in my ~/.bashrc, ~/.bash_profile or ~/.profile, /Library/Frameworks/Python.framework/Versions/2.6/bin is somehow getting appended to the beginning of my $PATH: 0 07:15:11pm ~ $ echo $PATH /Library/Frameworks/Python.framework/Versions/2.6/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin I'd like to remove it as the MacPorts version of Python is newer. This must be appended after all the above-listed files are read, but I can't think of where. There is no mention of this in /etc/profile, /etc/bashrc or /etc/paths. Any assistance would be greatly appreciated. Thanks!

    Read the article

  • Using Traveling Salesman Solver to Decide Hamiltonian Path

    - by Firas Assaad
    This is for a project where I'm asked to implement a heuristic for the traveling salesman optimization problem and also the Hamiltonian path or cycle decision problem. I don't need help with the implementation itself, but have a question on the direction I'm going in. I already have a TSP heuristic based on a genetic algorithm: it assumes a complete graph, starts with a set of random solutions as a population, and works to improve the population for a number of generations. Can I also use it to solve the Hamiltonian path or cycle problems? Instead of optimizing to get the shortest path, I just want to check if there is a path. Now any complete graph will have a Hamiltonian path in it, so the TSP heuristic would have to be extended to any graph. This could be done by setting the edges to some infinity value if there is no path between two cities, and returning the first path that is a valid Hamiltonian path. Is that the right way to approach it? Or should I use a different heuristic for Hamiltonian path? My main concern is whether it's a viable approach since I can be somewhat sure that TSP optimization works (because you start with solutions and improve them) but not if a Hamiltonian path decider would find any path in a fixed number of generations. I assume the best approach would be to test it myself, but I'm constrained by time and thought I'd ask before going down this route... (I could find a different heuristic for Hamiltonian path instead)

    Read the article

  • Passing PATH through sudo

    - by whitequark
    In short: how to make sudo not to flush PATH everytime? I have some websites deployed on my server (Debian testing) written with Ruby on Rails. I use Mongrel+Nginx to host them, but there is one problem that comes when I need to restart Mongrel (e.g. after making some changes). All sites are checked in VCS (git, but it is not important) and have owner and group set to my user, whereas Mongrel runs under the, huh, mongrel user that is severely restricted in it's rights. So Mongrel must be started under root (it can automatically change UID) or mongrel. To manage mongrel I use mongrel_cluster gem because it allows starting or stopping any amount of Mongrel servers with just one command. But it needs the directory /var/lib/gems/1.8/bin to be in PATH: this is not enough to start it with absolute path. Modifying PATH in root .bashrc changed nothing, tweaking sudo's env_reset and keepenv didn't either. So the question: how to add a directory to PATH or keep user's PATH in sudo?

    Read the article

  • concatenate files including path in header - path contains spaces

    - by manolo
    I have to concatenate a number of files in a directory structure which contains spaces in the folder names looking like this: ./CH 0000100014/A10/11XT/11xt#001.csv find . -name "*.csv" -type f -print0 | xargs -0 cat > allmycsv.txt does the job, however now I need to include the information contained in the path, i.e. CH 0000100014/A10/11XT as a header of each inputfile to cat. find . -name "*.csv" -type f -print0 | xargs -0 -I % sh -c 'echo %; cat %' >allmycsv.txt would do the job, if I had no spaces in the path, but in my case, cat does not get along with the space in the path name. Is there a way out? Cheers, E P.S. I am working on bash on OSX

    Read the article

  • Cannot set ILMerge path to console

    - by KMC
    I install ILMerge.exe; path is C:\Program Files\Microsoft\ILMerge\ILMerge.exe. I want to set the command to the Path so I can type ilmerge anywhere to use the application. I googled and tried all the following but none works: setx -m ilmerge;C:\Program Files\Microsoft\ILMerge\ILMerge.exe setx -M ilmerge;C:\Program Files\Microsoft\ILMerge\ILMerge.exe setx -m %PATH%;C:\Program Files\Microsoft\ILMerge\ILMerge.exe setx /S system /U administrator ilmerge;C:\Program Files\Microsoft\ILMerge\ILMerge.exe I then tried to add, the GUI's Environment Variables, click New and input the variable "ilmerge" and value "C:\Program Files\Microsoft\ILMerge\ILMerge.exe". But in command prompt and type in ilmerge, still gives me 'ilmerge' is not recognized as an internal or external command, operable program or bath file. Why something as basic as setting a path that confusing..

    Read the article

  • Getting PATH right for python after MacPorts install

    - by BenjaminGolder
    I can't import some python libraries (PIL, psycopg2) that I just installed with MacPorts. I looked through these forums, and tried to adjust my PATH variable in $HOME/.bash_profile in order to fix this but it did not work. I added the location of PIL and psycopg2 to PATH. I know that Terminal is a version of python in /usr/local/bin, rather than the one installed by MacPorts at /opt/local/bin. Do I need to use the MacPorts version of Python in order to ensure that PIL and psycopg2 are on sys.path when I use python in Terminal? Should I switch to the MacPorts version of Python, or will that cause more problems? In case it is helpful, here are more facts: PIl and psycopg2 are installed in /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages which pythonreturns/usr/bin/python echo $PATHreturns (I separated each path for easy reading): :/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ :/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages :/opt/local/bin :/opt/local/sbin :/usr/local/git/bin :/usr/bin :/bin :/usr/sbin :/sbin :/usr/local/bin :/usr/local/git/bin :/usr/X11/bin :/opt/local/bin in python, sys.path returns: /Library/Frameworks/SQLite3.framework/Versions/3/Python /Library/Python/2.6/site-packages/numpy-override /Library/Frameworks/GDAL.framework/Versions/1.7/Python/site-packages /Library/Frameworks/cairo.framework/Versions/1/Python /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload /Library/Python/2.6/site-packages /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2.8-mac-unicode I welcome any criticism and comments, if any of the above looks foolish or poorly conceived. I'm new to all of this. Thanks! Running OSX 10.6.5 on a MacBook Pro, invoking python 2.6.1 from Terminal

    Read the article

  • Make PATH variable changes permanent on openSuse

    - by Marlon
    Okay, so I'm trying to do something that should be rather simple but for some reason I can't quite seem to make it work. All I simply want to do is add a path to the PATH environment variable in openSuse. So far, I've edited the following line in /etc/default/su : PATH=/usr/local/bin:/bin:/usr/bin with this line : PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/php/bin:/usr/local/mysql/bin Basically, all I want to do is have access to php and mysqld regardless of how I log in directly from the command prompt without having to type trailing /usr/local/php/bin/ every time. Am I even editing the right file? I'm a bit of a Linux newbie and to achieve something as trivial as this is eluding me. Server gods out there, drop be a crumb, please? :-)

    Read the article

  • Python version priority in OSX/UNIX PATH environment variable

    - by mindthief
    Hi all, I want my system to use /usr/bin/python, but it's currently using /opt/local/bin/python, which points to /usr/bin/python2.6. I tried modifying the PATH variable in my .bashrc as PATH=~/bin:$PATH ...and then set a symbolic link in ~/bin to point to /usr/bin/python. i.e. ~/bin/python --> /usr/bin/python I figured this might prioritize this symlink over the /opt/local version if it came before the other one in the PATH variable, but when I opened a new shell I still found python pointing to /opt/local/bin. Any advice on a good way to get the system to use /usr/bin/python? Also, I usually use ipython as opposed to python directly. I'm assuming that if the system starts to use the correct version of python then ipython would also use that version? If not, how could I also get ipython to use the correct version? Thanks!

    Read the article

  • How to copy files from shadow copy with long source path

    - by Jake
    The files and folders in my shared network drive (set up with DFS) were mass deleted. Currently I am trying to recover the files from the shadow copy "Previous Version". Problem is, thousands of files are deeply nested with long paths making the file path too long. When copying, it shows the dialog "Source Path Too Long". My guess is that the file path just barely hits the limit when saved into the network drive, but shadaw copy service appends the date and time to the folders so the path character limit is exceeded. How else can I copy the files from shadow copy?

    Read the article

  • Modify PATH variable for X11 during log-in

    - by user1028435
    I am working on some lab computers (read: no administrative rights) that, if I log in, I need to change the PATH variable as X11 starts. The reason is that I need to change the PATH variable at this time, as opposed to later, is that the Print Screen command seems to "bind" during login (forgive my bad explanation of this). Currently, I have a .bashrc script as a workaround: #!/bin/bash export PATH=/home/username/bin:$PATH I can make it work by starting a new X, but I was wondering if it is possible to change upon login. cat /etc/redhat-release tells me my distribution is: Red Hat Enterprise Linux Client release 5.8 (Tikanga)

    Read the article

  • Windows 7 - User-specific %PATH%

    - by MiffTheFox
    I'd like to set up a system for Windows 7 where each user has their own private directory in %PATH%. I tried setting %PATH% to %HOMEDRIVE%%HOMEPATH%\Bin;%SystemRoot%\System32;[...] but it doesn't seem to work. For those who don't realize what I'm trying to do, it's sort of like EXPORT PATH=~/bin would be on *nix. It can be on a user specific basis if need be (and that would actually be prefer to the machine-wide settings).

    Read the article

  • Could I do this blind relative to absolute path conversion (for perforce depot paths) better?

    - by wonderfulthunk
    I need to "blindly" (i.e. without access to the filesystem, in this case the source control server) convert some relative paths to absolute paths. So I'm playing with dotdots and indices. For those that are curious I have a log file produced by someone else's tool that sometimes outputs relative paths, and for performance reasons I don't want to access the source control server where the paths are located to check if they're valid and more easily convert them to their absolute path equivalents. I've gone through a number of (probably foolish) iterations trying to get it to work - mostly a few variations of iterating over the array of folders and trying delete_at(index) and delete_at(index-1) but my index kept incrementing while I was deleting elements of the array out from under myself, which didn't work for cases with multiple dotdots. Any tips on improving it in general or specifically the lack of non-consecutive dotdot support would be welcome. Currently this is working with my limited examples, but I think it could be improved. It can't handle non-consecutive '..' directories, and I am probably doing a lot of wasteful (and error-prone) things that I probably don't need to do because I'm a bit of a hack. I've found a lot of examples of converting other types of relative paths using other languages, but none of them seemed to fit my situation. These are my example paths that I need to convert, from: //depot/foo/../bar/single.c //depot/foo/docs/../../other/double.c //depot/foo/usr/bin/../../../else/more/triple.c to: //depot/bar/single.c //depot/other/double.c //depot/else/more/triple.c And my script: begin paths = File.open(ARGV[0]).readlines puts(paths) new_paths = Array.new paths.each { |path| folders = path.split('/') if ( folders.include?('..') ) num_dotdots = 0 first_dotdot = folders.index('..') last_dotdot = folders.rindex('..') folders.each { |item| if ( item == '..' ) num_dotdots += 1 end } if ( first_dotdot and ( num_dotdots > 0 ) ) # this might be redundant? folders.slice!(first_dotdot - num_dotdots..last_dotdot) # dependent on consecutive dotdots only end end folders.map! { |elem| if ( elem !~ /\n/ ) elem = elem + '/' else elem = elem end } new_paths << folders.to_s } puts(new_paths) end

    Read the article

  • Python os.path.join on Windows

    - by Jim
    I am trying to learn python and am making a program that will output a script. I want to use os.path.join, but am pretty confused. According to the docs if I say: os.path.join('c:', 'sourcedir') I get "C:sourcedir". According to the docs, this is normal, right? But when I use the copytree command, Python will output it the desired way, for example: import shutil src = os.path.join('c:', 'src') dst = os.path.join('c':', 'dst') shutil.copytree(src, dst) Here is the error code I get: WindowsError: [Error 3] The system cannot find the path specified: 'C:src/*.*' If I wrap the os.path.join with os.path.normpath I get the same error. If this os.path.join can't be used this way, then I am confused as to its purpose. According to the pages suggested by Stack Overflow, slashes should not be used in join—that is correct, I assume?

    Read the article

  • How to find full module path of a class to import in other file

    - by Pooya
    I have method that returns module path of given class name def findModulePath(path, className): attributes = [] for root, dirs, files in os.walk(path): for source in (s for s in files if s.endswith(".py")): name = os.path.splitext(os.path.basename(source))[0] full_name = os.path.splitext(source)[0].replace(os.path.sep, '.') m = imp.load_module(full_name, *imp.find_module(name, [root])) try: attr = getattr(m, className) attributes.append(attr) except: pass if len(attributes) <= 0: raise Exception, "Class %s not found" % className for element in attributes: print "%s.%s" % (element.__module__, className) but it does not return the full path of the module, For example I have a python file named "objectmodel" in objects package,and it contains a Model class, So I call findModulePath(MyProjectPath,"Model"). it prints objectmodel.Model but I need objects.objectmodel.Model

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >