question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CMake Error: The source directory "/tmp/pip-xxxx-build/khaiii-0.4" does not appear to contain CMakeLists.txt.

See original GitHub issue

python package 설치를 위해 pip3 install . 명령을 실행하면 다음과 같은 오류가 나타납니다.

user@host:~/khaiii/build/package_python$ pip3 install .
Processing /khaiii_build/khaiii/build/package_python
Installing collected packages: khaiii
  Running setup.py install for khaiii ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-478gf4ho-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-bm0ekidn-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
    running install
    running build
    CMake Error: The source directory "/tmp/pip-478gf4ho-build/khaiii-0.4" does not appear to contain CMakeLists.txt.
    Specify --help for usage, or press the help button on the CMake GUI.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-478gf4ho-build/setup.py", line 94, in <module>
        cmdclass={'build': CustomBuild}
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 129, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/lib/python3.6/distutils/command/install.py", line 589, in run
        self.run_command('build')
      File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/tmp/pip-478gf4ho-build/setup.py", line 49, in run
        subprocess.check_call('cmake ..', cwd=build_dir, shell=True)
      File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command 'cmake ..' returned non-zero exit status 1.

    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-478gf4ho-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-bm0ekidn-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-478gf4ho-build/

사용 환경은 다음과 같습니다.

  • OS : Ubuntu 18.04
  • GCC : 7.4.0
  • CMake : 3.13.3
  • Python : 3.6.8
  • pip : 9.0.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
IAmEnchantcommented, Jul 12, 2019

알려주신 방법에도 소용 없어서 Ubuntu 19.04 환경에서 해보니 되더군요, 혹시나 하고 기존 Ubuntu 18.04 환경의 root 계정으로 해보니 또 되네요… 그래서 마지막으로 기존 계정의 ~/.hunter 디렉토리와 khaiii 디렉토리를 지우고 전부 다시 해서 성공했습니다. 원인은 모르겠지만 hunter workspace 구성에 문제가 있던 것 같습니다. 찝찝한 기분을 남기고 어정쩡하게 성공했네요.

user@host:~$ python3 test.py
안녕,   안녕/IC + ,/SP
세상.   세상/NNG + ./SF

비슷한 문제를 겪으시는 분이 생긴다면 ~/.hunter 디렉토리도 삭제해보시기 바랍니다. 신경써주셔서 감사합니다.

0reactions
krikitcommented, Jul 12, 2019

make package_source 명령에 의해 소스코드가 묶여서 khaiii-0.4.zip 파일이 생성되어야 하는데, 이때도 여전히 빈 zip 파일이 생성되네요. cpack 명령어가 제대로 동작하지 않는 것인데, 이런 경우는 처음이라 잘 모르겠네요. ㅠ.ㅠ

말씀하시는 cmake 버전을 보니 ubunbu 18.04의 apt 명령은 아니고 pip 명령으로 설치하신 듯 한데 맞나요? 다행히 ubuntu 18.04에서 apt로 설치 가능한 cmake 버전이 3.10 이상이라 다음과 같이 cmake를 새로 설치한 다음 한번 해보실 수 있을까요?

# 기존 pip로 설치한 cmake 제거
pip uninstall cmake

# log off and log in

# apt 명령을 통한 cmake 설치
apt update -y
apt install cmake
Read more comments on GitHub >

github_iconTop Results From Across the Web

python - cmake error 'the source does not appear to contain ...
You should do mkdir build and cd build while inside opencv folder, not the opencv-contrib folder. The CMakeLists.txt is there.
Read more >
Source directory does not appear to contain CMakeLists.txt?
It then says: CMake Error: The source directory “/Users/biancacaproni” does not appear to contain CMakeLists.txt. Then, when I try this command: cmake -D ......
Read more >
does not appear to contain CMakeLists.txt #34835 - GitHub
Cmake Error The source directory "/home/user/SignalR-Client-Cpp/submodules/vcpkg/scripts" does not appear to contain CMakeLists.txt.
Read more >
CMake Error: The source directory "/home/pi" does not appear ...
I'm trying to setup my build using CMake. My code and its' error is the following. How do I make CMakeLists? (cv) pi@raspberrypi:~/build...
Read more >
CMake Error: The source directory "C:/Program Files/SDL2 ...
txt ? Only the source package will have it, if you downloaded one of the binary packages there won't be a CMakeLists.txt because...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found